AVFoundation framework isn't always installed
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 21:47:37 +0000 (21:47 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 21:47:37 +0000 (21:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197577
<rdar://problem/50447841>

Reviewed by Jer Noble.

Use PAL::isAVFoundationFrameworkAvailable() to check to see if AVFoundation is
installed, not PAL::AVFoundationLibrary().

* platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
(WebCore::AVFoundationMIMETypeCache::isAvailable const):
(WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
(WebCore::exernalDeviceDisplayNameForPlayer):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
* platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
(WebCore::validateHEVCParameters):
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::isAvailable):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm
Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.mm
Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm

index fad278e..06b62a6 100644 (file)
@@ -1,3 +1,30 @@
+2019-05-03  Eric Carlson  <eric.carlson@apple.com>
+
+        AVFoundation framework isn't always installed
+        https://bugs.webkit.org/show_bug.cgi?id=197577
+        <rdar://problem/50447841>
+
+        Reviewed by Jer Noble.
+        
+        Use PAL::isAVFoundationFrameworkAvailable() to check to see if AVFoundation is
+        installed, not PAL::AVFoundationLibrary().
+
+        * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
+        (WebCore::AVFoundationMIMETypeCache::isAvailable const):
+        (WebCore::AVFoundationMIMETypeCache::loadMIMETypes):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::isAvailable):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
+        (WebCore::exernalDeviceDisplayNameForPlayer):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable):
+        * platform/graphics/cocoa/HEVCUtilitiesCocoa.mm:
+        (WebCore::validateHEVCParameters):
+        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
+        (WebCore::AVCaptureDeviceManager::isAvailable):
+
 2019-05-03  Sihui Liu  <sihui_liu@apple.com>
 
         Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
index 5a7bf69..fa2f077 100644 (file)
@@ -93,7 +93,7 @@ bool AVFoundationMIMETypeCache::isAvailable() const
 #if PLATFORM(IOSMAC)
     // FIXME: This should be using AVFoundationLibraryIsAvailable() instead, but doing so causes soft-linking
     // to subsequently fail on certain symbols. See <rdar://problem/42224780> for more details.
-    return PAL::AVFoundationLibrary();
+    return PAL::isAVFoundationFrameworkAvailable();
 #else
     return AVFoundationLibraryIsAvailable();
 #endif
@@ -109,7 +109,7 @@ void AVFoundationMIMETypeCache::loadMIMETypes()
 #if ENABLE(VIDEO) && USE(AVFOUNDATION)
     static std::once_flag onceFlag;
     std::call_once(onceFlag, [this] {
-        if (!PAL::AVFoundationLibrary())
+        if (!PAL::isAVFoundationFrameworkAvailable())
             return;
 
         for (NSString* type in [PAL::getAVURLAssetClass() audiovisualMIMETypes])
index 4e5b823..a9d7ebe 100644 (file)
@@ -1696,7 +1696,7 @@ void MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest(AVAssetResourceLo
 
 bool MediaPlayerPrivateAVFoundationObjC::isAvailable()
 {
-    return PAL::AVFoundationLibrary() && isCoreMediaFrameworkAvailable();
+    return PAL::isAVFoundationFrameworkAvailable() && isCoreMediaFrameworkAvailable();
 }
 
 MediaTime MediaPlayerPrivateAVFoundationObjC::mediaTimeForTimeValue(const MediaTime& timeValue) const
@@ -2576,7 +2576,7 @@ MediaPlayer::WirelessPlaybackTargetType MediaPlayerPrivateAVFoundationObjC::wire
         return MediaPlayer::TargetTypeNone;
 
 #if PLATFORM(IOS_FAMILY)
-    if (!PAL::AVFoundationLibrary())
+    if (!PAL::isAVFoundationFrameworkAvailable())
         return MediaPlayer::TargetTypeNone;
 
     switch ([m_avPlayer externalPlaybackType]) {
@@ -2600,7 +2600,7 @@ MediaPlayer::WirelessPlaybackTargetType MediaPlayerPrivateAVFoundationObjC::wire
 static NSString *exernalDeviceDisplayNameForPlayer(AVPlayer *player)
 {
 #if HAVE(CELESTIAL)
-    if (!PAL::AVFoundationLibrary())
+    if (!PAL::isAVFoundationFrameworkAvailable())
         return nil;
 
     if ([PAL::getAVOutputContextClass() respondsToSelector:@selector(sharedAudioPresentationOutputContext)]) {
index 7fb1a5e..331659d 100644 (file)
@@ -179,7 +179,7 @@ void MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(MediaEngineRegist
 
 bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable()
 {
-    return PAL::AVFoundationLibrary()
+    return PAL::isAVFoundationFrameworkAvailable()
         && isCoreMediaFrameworkAvailable()
         && getAVStreamDataParserClass()
         && getAVSampleBufferAudioRendererClass()
index cda97c9..3c74b5e 100644 (file)
@@ -226,7 +226,7 @@ void MediaPlayerPrivateMediaStreamAVFObjC::registerMediaEngine(MediaEngineRegist
 
 bool MediaPlayerPrivateMediaStreamAVFObjC::isAvailable()
 {
-    return PAL::AVFoundationLibrary() && isCoreMediaFrameworkAvailable() && getAVSampleBufferDisplayLayerClass();
+    return isAVFoundationFrameworkAvailable() && isCoreMediaFrameworkAvailable() && getAVSampleBufferDisplayLayerClass();
 }
 
 void MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types)
index 5050667..ae8854c 100644 (file)
@@ -41,7 +41,7 @@ bool validateHEVCParameters(HEVCParameterSet& parameters, MediaCapabilitiesInfo&
 {
     CMVideoCodecType codec = kCMVideoCodecType_HEVC;
     if (hasAlphaChannel) {
-        if (!PAL::AVFoundationLibrary() || !PAL::canLoad_AVFoundation_AVVideoCodecTypeHEVCWithAlpha())
+        if (!PAL::isAVFoundationFrameworkAvailable() || !PAL::canLoad_AVFoundation_AVVideoCodecTypeHEVCWithAlpha())
             return false;
 
         auto codecCode = FourCC::fromString(AVVideoCodecTypeHEVCWithAlpha);
index a9ea3e1..1c42e20 100644 (file)
@@ -160,7 +160,7 @@ void AVCaptureDeviceManager::refreshCaptureDevices()
 
 bool AVCaptureDeviceManager::isAvailable()
 {
-    return PAL::AVFoundationLibrary();
+    return PAL::isAVFoundationFrameworkAvailable();
 }
 
 AVCaptureDeviceManager& AVCaptureDeviceManager::singleton()