[Mac][EME] Query whether decoder support exists before creating a new MediaKeys object.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Mar 2014 21:27:10 +0000 (21:27 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Mar 2014 21:27:10 +0000 (21:27 +0000)
https://bugs.webkit.org/show_bug.cgi?id=130459

Reviewed by Eric Carlson.

Source/WebCore:

* WebCore.exp.in: Export the new WCSI method.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsKeySystem): Bail early if we have no decoder support.
* platform/mac/WebCoreSystemInterface.h: Provide a WCSI wrapper for WKSI.
* platform/mac/WebCoreSystemInterface.mm: Ditto.

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Initialize the new WCSI method.

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Initialize the new WCSI method.

WebKitLibraries:

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceMavericks.a:
* libWebKitSystemInterfaceMountainLion.a:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@165917 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceMavericks.a
WebKitLibraries/libWebKitSystemInterfaceMountainLion.a

index f92f9d6..a159d5f 100644 (file)
@@ -1,3 +1,16 @@
+2014-03-19  Jer Noble  <jer.noble@apple.com>
+
+        [Mac][EME] Query whether decoder support exists before creating a new MediaKeys object.
+        https://bugs.webkit.org/show_bug.cgi?id=130459
+
+        Reviewed by Eric Carlson.
+
+        * WebCore.exp.in: Export the new WCSI method.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsKeySystem): Bail early if we have no decoder support.
+        * platform/mac/WebCoreSystemInterface.h: Provide a WCSI wrapper for WKSI.
+        * platform/mac/WebCoreSystemInterface.mm: Ditto.
+
 2014-03-19  Eric Carlson  <eric.carlson@apple.com>
 
         Make Remote Control commands testable
index 262c564..508234d 100644 (file)
@@ -1998,6 +1998,7 @@ _wkHTTPCookies
 _wkHTTPCookiesForURL
 _wkHTTPRequestEnablePipelining
 _wkInitializeMaximumHTTPConnectionCountPerHost
+_wkQueryDecoderAvailability
 _wkSetBaseCTM
 _wkSetCFURLResponseMIMEType
 _wkSetCONNECTProxyAuthorizationForStream
index d26afff..a0d1a06 100644 (file)
@@ -34,6 +34,7 @@
 #import "MediaTimeMac.h"
 #import "PlatformClockCM.h"
 #import "SoftLinking.h"
+#import "WebCoreSystemInterface.h"
 #import <AVFoundation/AVAsset.h>
 #import <CoreMedia/CMSync.h>
 #import <QuartzCore/CALayer.h>
@@ -243,6 +244,9 @@ MediaPlayer::SupportsType MediaPlayerPrivateMediaSourceAVFObjC::supportsType(con
 bool MediaPlayerPrivateMediaSourceAVFObjC::supportsKeySystem(const String& keySystem, const String& mimeType)
 {
 #if ENABLE(ENCRYPTED_MEDIA_V2)
+    if (!wkQueryDecoderAvailability())
+        return false;
+
     if (!keySystem.isEmpty()) {
         if (!keySystemIsSupported(keySystem))
             return false;
index 05ae0ee..c53898a 100644 (file)
@@ -379,6 +379,8 @@ typedef enum {
 extern int (*wkExernalDeviceTypeForPlayer)(AVPlayer *);
 extern NSString *(*wkExernalDeviceDisplayNameForPlayer)(AVPlayer *);
 
+extern bool (*wkQueryDecoderAvailability)(void);
+
 }
 
 #endif
index fa9ab84..831be57 100644 (file)
@@ -215,3 +215,5 @@ CFStringRef (*wkCachePartitionKey)(void);
 
 int (*wkExernalDeviceTypeForPlayer)(AVPlayer *);
 NSString *(*wkExernalDeviceDisplayNameForPlayer)(AVPlayer *);
+
+bool (*wkQueryDecoderAvailability)(void);
index b17844e..ce062aa 100644 (file)
@@ -1,3 +1,13 @@
+2014-03-19  Jer Noble  <jer.noble@apple.com>
+
+        [Mac][EME] Query whether decoder support exists before creating a new MediaKeys object.
+        https://bugs.webkit.org/show_bug.cgi?id=130459
+
+        Reviewed by Eric Carlson.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Initialize the new WCSI method.
+
 2014-03-19  Brady Eidson  <beidson@apple.com>
 
         Filter out editable services from image menu for non-contenteditable images
index 63d925c..a8d2f19 100644 (file)
@@ -247,5 +247,7 @@ void InitWebCoreSystemInterface(void)
     INIT(ExernalDeviceTypeForPlayer);
     INIT(ExernalDeviceDisplayNameForPlayer);
 
+    INIT(QueryDecoderAvailability);
+
     didInit = true;
 }
index 5dcfde0..0178dc5 100644 (file)
@@ -1,3 +1,13 @@
+2014-03-19  Jer Noble  <jer.noble@apple.com>
+
+        [Mac][EME] Query whether decoder support exists before creating a new MediaKeys object.
+        https://bugs.webkit.org/show_bug.cgi?id=130459
+
+        Reviewed by Eric Carlson.
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Initialize the new WCSI method.
+
 2014-03-19  Brady Eidson  <beidson@apple.com>
 
         Filter out editable services from image menu for non-contenteditable images
index faaf767..12e76eb 100644 (file)
@@ -234,5 +234,7 @@ void InitWebCoreSystemInterface(void)
         
         INIT(ExernalDeviceTypeForPlayer);
         INIT(ExernalDeviceDisplayNameForPlayer);
+
+        INIT(QueryDecoderAvailability);
     });
 }
index 4248871..0ed549d 100644 (file)
@@ -1,3 +1,14 @@
+2014-03-19  Jer Noble  <jer.noble@apple.com>
+
+        [Mac][EME] Query whether decoder support exists before creating a new MediaKeys object.
+        https://bugs.webkit.org/show_bug.cgi?id=130459
+
+        Reviewed by Eric Carlson.
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceMavericks.a:
+        * libWebKitSystemInterfaceMountainLion.a:
+
 2014-03-18  Alex Christensen  <achristensen@webkit.org>
 
         [WinCairo] Unreviewed build fix after r165763.
index 8b9e2db..d6fc950 100644 (file)
@@ -561,6 +561,8 @@ typedef enum {
 int WKExernalDeviceTypeForPlayer(AVPlayer *);
 NSString *WKExernalDeviceDisplayNameForPlayer(AVPlayer *);
 
+bool WKQueryDecoderAvailability(void);
+
 #ifdef __cplusplus
 }
 #endif
index f9ecc35..6576870 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceMavericks.a and b/WebKitLibraries/libWebKitSystemInterfaceMavericks.a differ
index 5db52b6..880754e 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a and b/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a differ