Title: [290076] trunk/Source
Revision
290076
Author
[email protected]
Date
2022-02-17 14:41:18 -0800 (Thu, 17 Feb 2022)

Log Message

[Cocoa] Make AVFoundationSPI.h robust against changes in system headers
https://bugs.webkit.org/show_bug.cgi?id=236787

Reviewed by Eric Carlson.

Source/WebCore/PAL:

Only re-declare classes and add categories for non-Apple Internal builds, or when those
definitions would be missing from system headers. The presence of the classes and their
methods are already checked at runtime, so this is a build-only change.

* pal/spi/cocoa/AVFoundationSPI.h:

Source/WTF:

* wtf/PlatformHave.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (290075 => 290076)


--- trunk/Source/WTF/ChangeLog	2022-02-17 22:39:54 UTC (rev 290075)
+++ trunk/Source/WTF/ChangeLog	2022-02-17 22:41:18 UTC (rev 290076)
@@ -1,3 +1,12 @@
+2022-02-17  Jer Noble  <[email protected]>
+
+        [Cocoa] Make AVFoundationSPI.h robust against changes in system headers
+        https://bugs.webkit.org/show_bug.cgi?id=236787
+
+        Reviewed by Eric Carlson.
+
+        * wtf/PlatformHave.h:
+
 2022-02-17  Nikolaos Mouchtaris  <[email protected]>
 
         Enable CSS Motion Path by default

Modified: trunk/Source/WTF/wtf/PlatformHave.h (290075 => 290076)


--- trunk/Source/WTF/wtf/PlatformHave.h	2022-02-17 22:39:54 UTC (rev 290075)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2022-02-17 22:41:18 UTC (rev 290076)
@@ -388,6 +388,18 @@
 #define HAVE_AVCONTENTKEYSESSION 1
 #endif
 
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101504) \
+    || (((PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130400) \
+    || (PLATFORM(WATCHOS) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __WATCH_OS_VERSION_MAX_ALLOWED >= 60400) \
+    || (PLATFORM(APPLETV) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __TV_OS_VERSION_MAX_ALLOWED >= 130400)
+#define HAVE_AVCONTENTKEYREPORTGROUP 1
+#endif
+
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000) \
+    || (((PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000)
+#define HAVE_AVCONTENTKEYSESSIONWILLOUTPUTBEOBSCURED 1
+#endif
+
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 110300) \
     || (((PLATFORM(IOS) && !PLATFORM(IOS_FAMILY_SIMULATOR)) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500) \
     || (PLATFORM(WATCHOS) && !PLATFORM(IOS_FAMILY_SIMULATOR) && __WATCH_OS_VERSION_MAX_ALLOWED >= 70400) \

Modified: trunk/Source/WebCore/PAL/ChangeLog (290075 => 290076)


--- trunk/Source/WebCore/PAL/ChangeLog	2022-02-17 22:39:54 UTC (rev 290075)
+++ trunk/Source/WebCore/PAL/ChangeLog	2022-02-17 22:41:18 UTC (rev 290076)
@@ -1,3 +1,16 @@
+2022-02-17  Jer Noble  <[email protected]>
+
+        [Cocoa] Make AVFoundationSPI.h robust against changes in system headers
+        https://bugs.webkit.org/show_bug.cgi?id=236787
+
+        Reviewed by Eric Carlson.
+
+        Only re-declare classes and add categories for non-Apple Internal builds, or when those
+        definitions would be missing from system headers. The presence of the classes and their
+        methods are already checked at runtime, so this is a build-only change.
+
+        * pal/spi/cocoa/AVFoundationSPI.h:
+
 2022-02-15  Myles C. Maxfield  <[email protected]>
 
         [WebGPU] Update IDLs and stubs to latest version of the spec

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h (290075 => 290076)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h	2022-02-17 22:39:54 UTC (rev 290075)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/AVFoundationSPI.h	2022-02-17 22:41:18 UTC (rev 290076)
@@ -37,6 +37,7 @@
 
 #import <AVFoundation/AVAssetCache_Private.h>
 #import <AVFoundation/AVCaptureSession_Private.h>
+#import <AVFoundation/AVContentKeySession_Private.h>
 #import <AVFoundation/AVMediaSelectionGroup_Private.h>
 #import <AVFoundation/AVOutputContext_Private.h>
 #import <AVFoundation/AVOutputDevice.h>
@@ -224,6 +225,8 @@
 #import <AVFoundation/AVPlayerLayer.h>
 
 #if HAVE(AVCONTENTKEYSESSION)
+
+#if !USE(APPLE_INTERNAL_SDK) || !HAVE(AVCONTENTKEYREPORTGROUP)
 @interface AVContentKeyReportGroup : NSObject
 @property (readonly, nullable) NSData *contentProtectionSessionIdentifier;
 - (void)expire;
@@ -235,14 +238,17 @@
 @property (readonly, nullable) AVContentKeyReportGroup *defaultContentKeyGroup;
 - (nonnull AVContentKeyReportGroup *)makeContentKeyGroup;
 @end
+#endif
 
+#if !USE(APPLE_INTERNAL_SDK) || !HAVE(AVCONTENTKEYSESSIONWILLOUTPUTBEOBSCURED)
 @interface AVContentKeyRequest (OutputObscured)
 NS_ASSUME_NONNULL_BEGIN
 - (BOOL)willOutputBeObscuredDueToInsufficientExternalProtectionForDisplays:(NSArray<NSNumber *> *)displays;
 NS_ASSUME_NONNULL_END
 @end
+#endif
 
-#if HAVE(AVCONTENTKEYREQUEST_PENDING_PROTECTION_STATUS)
+#if !USE(APPLE_INTERNAL_SDK) || !HAVE(AVCONTENTKEYREQUEST_PENDING_PROTECTION_STATUS)
 typedef NS_ENUM(NSInteger, AVExternalContentProtectionStatus) {
     AVExternalContentProtectionStatusPending      = 0,
     AVExternalContentProtectionStatusSufficient   = 1,
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to