Diff
Modified: branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/ChangeLog (279161 => 279162)
--- branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/ChangeLog 2021-06-23 01:16:57 UTC (rev 279161)
+++ branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/ChangeLog 2021-06-23 01:16:59 UTC (rev 279162)
@@ -1,46 +1,5 @@
2021-06-22 Russell Epstein <[email protected]>
- Cherry-pick r279101. rdar://problem/79474211
-
- [Mac] libwebrtc CMBaseClass objects need alignment fixup
- https://bugs.webkit.org/show_bug.cgi?id=227137
- <rdar://problem/79464124>
-
- Reviewed by Youenn Fablet.
-
- * Source/webrtc/sdk/WebKit/WebKitDecoder.h: Define CMBASE_OBJECT_NEEDS_ALIGNMENT.
-
- * Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp:
- (webrtc::createWebKitVP8Decoder): Add padding to the CMBaseClass object on Mac and
- Mac Catalyst when building for x86_64 so function pointers are naturally aligned.
- Add static_asserts to ensure alignment and sizes are correct.
-
- * Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp:
- (webrtc::createWebKitVP9Decoder): Ditto.
-
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@279101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2021-06-21 Eric Carlson <[email protected]>
-
- [Mac] libwebrtc CMBaseClass objects need alignment fixup
- https://bugs.webkit.org/show_bug.cgi?id=227137
- <rdar://problem/79464124>
-
- Reviewed by Youenn Fablet.
-
- * Source/webrtc/sdk/WebKit/WebKitDecoder.h: Define CMBASE_OBJECT_NEEDS_ALIGNMENT.
-
- * Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp:
- (webrtc::createWebKitVP8Decoder): Add padding to the CMBaseClass object on Mac and
- Mac Catalyst when building for x86_64 so function pointers are naturally aligned.
- Add static_asserts to ensure alignment and sizes are correct.
-
- * Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp:
- (webrtc::createWebKitVP9Decoder): Ditto.
-
-2021-06-22 Russell Epstein <[email protected]>
-
Cherry-pick r278906. rdar://problem/79581492
Enable kVTVideoEncoderSpecification_RequiredLowLatency in case of MacOS software encoder
Modified: branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitDecoder.h (279161 => 279162)
--- branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitDecoder.h 2021-06-23 01:16:57 UTC (rev 279161)
+++ branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitDecoder.h 2021-06-23 01:16:59 UTC (rev 279162)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,7 +25,6 @@
#pragma once
-#include <Availability.h>
#include "WebKitUtilities.h"
#include "api/video_codecs/video_decoder_factory.h"
@@ -33,12 +32,6 @@
namespace webrtc {
-#if (TARGET_OS_OSX || TARGET_OS_MACCATALYST) && TARGET_CPU_X86_64
- #define CMBASE_OBJECT_NEEDS_ALIGNMENT 1
-#else
- #define CMBASE_OBJECT_NEEDS_ALIGNMENT 0
-#endif
-
struct SdpVideoFormat;
class VideoDecoderFactory;
@@ -53,6 +46,7 @@
std::unique_ptr<webrtc::VideoDecoderFactory> createWebKitDecoderFactory(WebKitH265, WebKitVP9, WebKitVP9VTB);
void videoDecoderTaskComplete(void* callback, uint32_t timeStamp, CVPixelBufferRef, uint32_t timeStampRTP);
+
using LocalDecoder = void*;
using LocalDecoderCallback = void (^)(CVPixelBufferRef, uint32_t timeStamp, uint32_t timeStampNs);
void* createLocalH264Decoder(LocalDecoderCallback);
Modified: branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp (279161 => 279162)
--- branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp 2021-06-23 01:16:57 UTC (rev 279161)
+++ branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitVP8Decoder.cpp 2021-06-23 01:16:59 UTC (rev 279162)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -47,43 +47,20 @@
static void finalizeVP8Decoder(CMBaseObjectRef);
static CFStringRef copyVP8DecoderDebugDescription(CMBaseObjectRef);
-#if defined(CMBASE_OBJECT_NEEDS_ALIGNMENT) && CMBASE_OBJECT_NEEDS_ALIGNMENT
- constexpr size_t padSize = 4;
-#else
- constexpr size_t padSize = 0;
-#endif
-
-#pragma pack(push, 4)
-struct DecoderClass {
- uint8_t pad[padSize];
- CMBaseClass alignedClass;
+static const CMBaseClass WebKitVP8Decoder_BaseClass =
+{
+ kCMBaseObject_ClassVersion_1,
+ sizeof(WebKitVP8Decoder),
+ nullptr, // Comparison by pointer equality
+ invalidateVP8Decoder,
+ finalizeVP8Decoder,
+ copyVP8DecoderDebugDescription,
+ nullptr, // CopyProperty
+ nullptr, // SetProperty
+ nullptr,
+ nullptr
};
-static const DecoderClass WebKitVP8Decoder_BaseClass {
- { },
- {
- kCMBaseObject_ClassVersion_1,
- sizeof(WebKitVP8Decoder),
- nullptr, // Comparison by pointer equality
- invalidateVP8Decoder,
- finalizeVP8Decoder,
- copyVP8DecoderDebugDescription,
- nullptr, // CopyProperty
- nullptr, // SetProperty
- nullptr,
- nullptr
- }
-};
-#pragma pack(pop)
-
-#if defined(CMBASE_OBJECT_NEEDS_ALIGNMENT) && CMBASE_OBJECT_NEEDS_ALIGNMENT
- static_assert(sizeof(WebKitVP8Decoder_BaseClass.alignedClass.version) == sizeof(uint32_t), "CMBaseClass fixup is required!");
-#else
- static_assert(sizeof(WebKitVP8Decoder_BaseClass.alignedClass.version) == sizeof(uintptr_t), "CMBaseClass fixup is not required!");
-#endif
-static_assert(offsetof(DecoderClass, alignedClass) == padSize, "CMBaseClass offset is incorrect!");
-static_assert(alignof(DecoderClass) == 4, "CMBaseClass must have 4 byte alignment");
-
static OSStatus startVP8DecoderSession(VTVideoDecoderRef, VTVideoDecoderSession, CMVideoFormatDescriptionRef);
static OSStatus decodeVP8DecoderFrame(VTVideoDecoderRef, VTVideoDecoderFrame, CMSampleBufferRef, VTDecodeFrameFlags, VTDecodeInfoFlags*);
@@ -104,7 +81,7 @@
static const VTVideoDecoderVTable WebKitVP8DecoderVTable =
{
- { nullptr, &WebKitVP8Decoder_BaseClass.alignedClass },
+ { nullptr, &WebKitVP8Decoder_BaseClass },
&WebKitVP8Decoder_VideoDecoderClass
};
Modified: branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp (279161 => 279162)
--- branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp 2021-06-23 01:16:57 UTC (rev 279161)
+++ branches/safari-611.3.10.1-branch/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitVP9Decoder.cpp 2021-06-23 01:16:59 UTC (rev 279162)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020-2021 Apple Inc. All rights reserved.
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -47,43 +47,20 @@
static void finalizeVP9Decoder(CMBaseObjectRef);
static CFStringRef copyVP9DecoderDebugDescription(CMBaseObjectRef);
-#if defined(CMBASE_OBJECT_NEEDS_ALIGNMENT) && CMBASE_OBJECT_NEEDS_ALIGNMENT
- constexpr size_t padSize = 4;
-#else
- constexpr size_t padSize = 0;
-#endif
-
-#pragma pack(push, 4)
-struct DecoderClass {
- uint8_t pad[padSize];
- CMBaseClass alignedClass;
+static const CMBaseClass WebKitVP9Decoder_BaseClass =
+{
+ kCMBaseObject_ClassVersion_1,
+ sizeof(WebKitVP9Decoder),
+ nullptr, // Comparison by pointer equality
+ invalidateVP9Decoder,
+ finalizeVP9Decoder,
+ copyVP9DecoderDebugDescription,
+ nullptr, // CopyProperty
+ nullptr, // SetProperty
+ nullptr,
+ nullptr
};
-static const DecoderClass WebKitVP9Decoder_BaseClass {
- { },
- {
- kCMBaseObject_ClassVersion_1,
- sizeof(WebKitVP9Decoder),
- nullptr, // Comparison by pointer equality
- invalidateVP9Decoder,
- finalizeVP9Decoder,
- copyVP9DecoderDebugDescription,
- nullptr, // CopyProperty
- nullptr, // SetProperty
- nullptr,
- nullptr
- }
-};
-#pragma pack(pop)
-
-#if defined(CMBASE_OBJECT_NEEDS_ALIGNMENT) && CMBASE_OBJECT_NEEDS_ALIGNMENT
- static_assert(sizeof(WebKitVP9Decoder_BaseClass.alignedClass.version) == sizeof(uint32_t), "CMBaseClass fixup is required!");
-#else
- static_assert(sizeof(WebKitVP9Decoder_BaseClass.alignedClass.version) == sizeof(uintptr_t), "CMBaseClass fixup is not required!");
-#endif
-static_assert(offsetof(DecoderClass, alignedClass) == padSize, "CMBaseClass offset is incorrect!");
-static_assert(alignof(DecoderClass) == 4, "CMBaseClass must have 4 byte alignment");
-
static OSStatus startVP9DecoderSession(VTVideoDecoderRef, VTVideoDecoderSession, CMVideoFormatDescriptionRef);
static OSStatus decodeVP9DecoderFrame(VTVideoDecoderRef, VTVideoDecoderFrame, CMSampleBufferRef, VTDecodeFrameFlags, VTDecodeInfoFlags*);
@@ -104,7 +81,7 @@
static const VTVideoDecoderVTable WebKitVP9DecoderVTable =
{
- { nullptr, &WebKitVP9Decoder_BaseClass.alignedClass },
+ { nullptr, &WebKitVP9Decoder_BaseClass },
&WebKitVP9Decoder_VideoDecoderClass
};