Changeset 244980 in webkit


Ignore:
Timestamp:
May 6, 2019 3:22:26 PM (5 years ago)
Author:
jer.noble@apple.com
Message:

Adopt AVStreamDataParser.audiovisualMIMETypes
https://bugs.webkit.org/show_bug.cgi?id=197581
<rdar://problem/50458981>

Reviewed by Eric Carlson.

Source/WebCore:

Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise
AVAssetMIMETypeCache. Update all the old AVFoundationMIMETypeCache with the new name.

  • SourcesCocoa.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h.

(WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback):

  • platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm.

(WebCore::AVAssetMIMETypeCache::singleton):
(WebCore::AVAssetMIMETypeCache::setSupportedTypes):
(WebCore::AVAssetMIMETypeCache::types):
(WebCore::AVAssetMIMETypeCache::supportsContentType):
(WebCore::AVAssetMIMETypeCache::canDecodeType):
(WebCore::AVAssetMIMETypeCache::isAvailable const):
(WebCore::AVAssetMIMETypeCache::loadMIMETypes):

  • platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added.
  • platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added.

(WebCore::AVStreamDataParserMIMETypeCache::singleton):
(WebCore::AVStreamDataParserMIMETypeCache::types):
(WebCore::AVStreamDataParserMIMETypeCache::supportsContentType):
(WebCore::AVStreamDataParserMIMETypeCache::canDecodeType):
(WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
(WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes):

  • platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:

(WebCore::ImageDecoderAVFObjC::create):
(WebCore::ImageDecoderAVFObjC::supportsMediaType):
(WebCore::ImageDecoderAVFObjC::supportsContentType):
(WebCore::ImageDecoderAVFObjC::canDecodeType):

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
(WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):

  • platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:

(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):

Source/WebKit:

  • WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::WebProcess::platformInitializeWebProcess):
(WebKit::WebProcess::platformTerminate):
(WebKit::WebProcess::setMediaMIMETypes):

Location:
trunk/Source
Files:
2 added
8 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244977 r244980  
     12019-05-06  Jer Noble  <jer.noble@apple.com>
     2
     3        Adopt AVStreamDataParser.audiovisualMIMETypes
     4        https://bugs.webkit.org/show_bug.cgi?id=197581
     5        <rdar://problem/50458981>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Add a new singleton class, AVStreamDataParserMIMETypeCache, and rename AVFoundationMIMETypeCache to the more precise
     10        AVAssetMIMETypeCache.  Update all the old AVFoundationMIMETypeCache with the new name.
     11
     12        * SourcesCocoa.txt:
     13        * WebCore.xcodeproj/project.pbxproj:
     14        * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h.
     15        (WebCore::AVAssetMIMETypeCache::setCacheMIMETypesCallback):
     16        * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm: Renamed from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm.
     17        (WebCore::AVAssetMIMETypeCache::singleton):
     18        (WebCore::AVAssetMIMETypeCache::setSupportedTypes):
     19        (WebCore::AVAssetMIMETypeCache::types):
     20        (WebCore::AVAssetMIMETypeCache::supportsContentType):
     21        (WebCore::AVAssetMIMETypeCache::canDecodeType):
     22        (WebCore::AVAssetMIMETypeCache::isAvailable const):
     23        (WebCore::AVAssetMIMETypeCache::loadMIMETypes):
     24        * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h: Added.
     25        * platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm: Added.
     26        (WebCore::AVStreamDataParserMIMETypeCache::singleton):
     27        (WebCore::AVStreamDataParserMIMETypeCache::types):
     28        (WebCore::AVStreamDataParserMIMETypeCache::supportsContentType):
     29        (WebCore::AVStreamDataParserMIMETypeCache::canDecodeType):
     30        (WebCore::AVStreamDataParserMIMETypeCache::isAvailable const):
     31        (WebCore::AVStreamDataParserMIMETypeCache::loadMIMETypes):
     32        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
     33        (WebCore::ImageDecoderAVFObjC::create):
     34        (WebCore::ImageDecoderAVFObjC::supportsMediaType):
     35        (WebCore::ImageDecoderAVFObjC::supportsContentType):
     36        (WebCore::ImageDecoderAVFObjC::canDecodeType):
     37        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     38        (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine):
     39        (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes):
     40        (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
     41        (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
     42        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
     43        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine):
     44        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes):
     45        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
     46
    1472019-05-06  Youenn Fablet  <youenn@apple.com>
    248
  • trunk/Source/WebCore/SourcesCocoa.txt

    r244588 r244980  
    232232platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp @no-unify
    233233
     234platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm @no-unify
    234235platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm @no-unify
    235 platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm @no-unify
     236platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm @no-unify
    236237platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm @no-unify
    237238platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp @no-unify
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r244977 r244980  
    102102                070E81D11BF27656001FDA48 /* VideoTrackPrivateMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E81D01BF27656001FDA48 /* VideoTrackPrivateMediaStream.h */; };
    103103                070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */; };
    104                 0719427F1D088F21002AA51D /* AVFoundationMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07C8AD111D073D630087C5CE /* AVFoundationMIMETypeCache.mm */; };
     104                0719427F1D088F21002AA51D /* AVAssetMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07C8AD111D073D630087C5CE /* AVAssetMIMETypeCache.mm */; };
    105105                071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 071A9EC0168FB56C002629F9 /* TextTrackCueGeneric.cpp */; };
    106106                071A9EC3168FBC55002629F9 /* TextTrackCueGeneric.h in Headers */ = {isa = PBXBuildFile; fileRef = 071A9EC1168FB56C002629F9 /* TextTrackCueGeneric.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    228228                07EE76EF1BEA619800F89133 /* MockRealtimeVideoSourceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76ED1BEA619800F89133 /* MockRealtimeVideoSourceMac.h */; };
    229229                07F04A942006B1E300AE2A0A /* ApplicationStateChangeListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F04A92200684BC00AE2A0A /* ApplicationStateChangeListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
    230                 07F4E93320B3587F002E3803 /* AVFoundationMIMETypeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C8AD121D073D630087C5CE /* AVFoundationMIMETypeCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
     230                07F4E93320B3587F002E3803 /* AVAssetMIMETypeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C8AD121D073D630087C5CE /* AVAssetMIMETypeCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
    231231                07F876841AD580F900905849 /* MediaPlaybackTargetContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
    232232                07F944161864D046005D31CB /* PlatformMediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    39983998                CD063F831E23FA8900812BE3 /* InitDataRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = CD063F811E23FA8900812BE3 /* InitDataRegistry.h */; };
    39993999                CD0EEE0E14743F39003EAFA2 /* AudioDestinationIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD0EEE0B14743E35003EAFA2 /* AudioDestinationIOS.cpp */; };
     4000                CD11B3E1227CE6F30023AFC7 /* AVStreamDataParserMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD11B3E0227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.mm */; };
    40004001                CD127DEE14F3098400E84779 /* WebCoreFullScreenWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */; settings = {ATTRIBUTES = (Private, ); }; };
    40014002                CD17A45D213740810079EC7B /* UnifiedSource62-mm.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD17A459213740160079EC7B /* UnifiedSource62-mm.mm */; };
     
    54945495                07C1C0E11BFB600100BD2256 /* MediaTrackSupportedConstraints.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaTrackSupportedConstraints.idl; sourceTree = "<group>"; };
    54955496                07C1C0E41BFB60ED00BD2256 /* RealtimeMediaSourceSupportedConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RealtimeMediaSourceSupportedConstraints.h; sourceTree = "<group>"; };
    5496                 07C8AD111D073D630087C5CE /* AVFoundationMIMETypeCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVFoundationMIMETypeCache.mm; sourceTree = "<group>"; };
    5497                 07C8AD121D073D630087C5CE /* AVFoundationMIMETypeCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVFoundationMIMETypeCache.h; sourceTree = "<group>"; };
     5497                07C8AD111D073D630087C5CE /* AVAssetMIMETypeCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVAssetMIMETypeCache.mm; sourceTree = "<group>"; };
     5498                07C8AD121D073D630087C5CE /* AVAssetMIMETypeCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVAssetMIMETypeCache.h; sourceTree = "<group>"; };
    54985499                07CE77D416712A6A00C55A47 /* InbandTextTrackPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandTextTrackPrivateClient.h; sourceTree = "<group>"; };
    54995500                07D60924214C5BFB00E7396C /* WindowDisplayCaptureSourceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowDisplayCaptureSourceMac.mm; sourceTree = "<group>"; };
     
    1343013431                CD0EEE0A14743E34003EAFA2 /* AudioDestinationIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioDestinationIOS.h; sourceTree = "<group>"; };
    1343113432                CD0EEE0B14743E35003EAFA2 /* AudioDestinationIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioDestinationIOS.cpp; sourceTree = "<group>"; };
     13433                CD11B3DF227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AVStreamDataParserMIMETypeCache.h; sourceTree = "<group>"; };
     13434                CD11B3E0227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AVStreamDataParserMIMETypeCache.mm; sourceTree = "<group>"; };
    1343213435                CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenWindow.h; sourceTree = "<group>"; };
    1343313436                CD127DEB14F3097900E84779 /* WebCoreFullScreenWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFullScreenWindow.mm; sourceTree = "<group>"; };
     
    2592125924                                CDECA8991EDF447D00DCB08B /* AVAssetTrackUtilities.h */,
    2592225925                                CDECA8981EDF447D00DCB08B /* AVAssetTrackUtilities.mm */,
    25923                                 07C8AD121D073D630087C5CE /* AVFoundationMIMETypeCache.h */,
    25924                                 07C8AD111D073D630087C5CE /* AVFoundationMIMETypeCache.mm */,
     25926                                07C8AD121D073D630087C5CE /* AVAssetMIMETypeCache.h */,
     25927                                07C8AD111D073D630087C5CE /* AVAssetMIMETypeCache.mm */,
     25928                                CD11B3DF227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.h */,
     25929                                CD11B3E0227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.mm */,
    2592525930                                CD78A2EE1F75648600DE371B /* CDMInstanceFairPlayStreamingAVFObjC.h */,
    2592625931                                CD78A2EC1F75648600DE371B /* CDMInstanceFairPlayStreamingAVFObjC.mm */,
     
    2823428239                                CDC675231EAEA9B700727C84 /* AVAudioSessionCaptureDeviceManager.h in Headers */,
    2823528240                                070363E2181A1CDC00C074A5 /* AVCaptureDeviceManager.h in Headers */,
    28236                                 07F4E93320B3587F002E3803 /* AVFoundationMIMETypeCache.h in Headers */,
     28241                                07F4E93320B3587F002E3803 /* AVAssetMIMETypeCache.h in Headers */,
    2823728242                                CD336F6217F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h in Headers */,
    2823828243                                070363E6181A1CDC00C074A5 /* AVVideoCaptureSource.h in Headers */,
     
    3257432579                                CDC675221EAEA9B700727C84 /* AVAudioSessionCaptureDeviceManager.mm in Sources */,
    3257532580                                070363E3181A1CDC00C074A5 /* AVCaptureDeviceManager.mm in Sources */,
    32576                                 0719427F1D088F21002AA51D /* AVFoundationMIMETypeCache.mm in Sources */,
     32581                                0719427F1D088F21002AA51D /* AVAssetMIMETypeCache.mm in Sources */,
    3257732582                                CD336F6117F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.mm in Sources */,
    3257832583                                070363E7181A1CDC00C074A5 /* AVVideoCaptureSource.mm in Sources */,
     
    3301733022                                DECA803A1F9FED6A00E3B661 /* UnifiedSource249.cpp in Sources */,
    3301833023                                DECA803B1F9FED6A00E3B661 /* UnifiedSource250.cpp in Sources */,
     33024                                CD11B3E1227CE6F30023AFC7 /* AVStreamDataParserMIMETypeCache.mm in Sources */,
    3301933025                                DECA803C1F9FED6A00E3B661 /* UnifiedSource251.cpp in Sources */,
    3302033026                                DECA803D1F9FED6A00E3B661 /* UnifiedSource252.cpp in Sources */,
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h

    r244979 r244980  
    3636class ContentType;
    3737
    38 class AVFoundationMIMETypeCache {
     38class AVAssetMIMETypeCache {
    3939public:
    40     WEBCORE_EXPORT static AVFoundationMIMETypeCache& singleton();
     40    WEBCORE_EXPORT static AVAssetMIMETypeCache& singleton();
    4141
    4242    bool supportsContentType(const ContentType&);
     
    5353
    5454private:
    55     friend NeverDestroyed<AVFoundationMIMETypeCache>;
    56     AVFoundationMIMETypeCache() = default;
     55    friend NeverDestroyed<AVAssetMIMETypeCache>;
     56    AVAssetMIMETypeCache() = default;
    5757
    5858    void loadMIMETypes();
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm

    r244979 r244980  
    2525
    2626#import "config.h"
    27 #import "AVFoundationMIMETypeCache.h"
     27#import "AVAssetMIMETypeCache.h"
    2828
    2929#if PLATFORM(COCOA)
    3030
    3131#import "ContentType.h"
    32 #import <wtf/HashSet.h>
    33 
    3432#import <pal/cf/CoreMediaSoftLink.h>
    3533#import <pal/cocoa/AVFoundationSoftLink.h>
     34#import <wtf/HashSet.h>
    3635
    3736#if !PLATFORM(IOSMAC)
     
    4140namespace WebCore {
    4241
    43 AVFoundationMIMETypeCache& AVFoundationMIMETypeCache::singleton()
     42AVAssetMIMETypeCache& AVAssetMIMETypeCache::singleton()
    4443{
    45     static NeverDestroyed<AVFoundationMIMETypeCache> cache;
     44    static NeverDestroyed<AVAssetMIMETypeCache> cache;
    4645    return cache.get();
    4746}
    4847
    49 void AVFoundationMIMETypeCache::setSupportedTypes(const Vector<String>& types)
     48void AVAssetMIMETypeCache::setSupportedTypes(const Vector<String>& types)
    5049{
    5150    if (m_cache)
     
    5756}
    5857
    59 const HashSet<String, ASCIICaseInsensitiveHash>& AVFoundationMIMETypeCache::types()
     58const HashSet<String, ASCIICaseInsensitiveHash>& AVAssetMIMETypeCache::types()
    6059{
    6160    if (!m_cache)
     
    6564}
    6665
    67 bool AVFoundationMIMETypeCache::supportsContentType(const ContentType& contentType)
     66bool AVAssetMIMETypeCache::supportsContentType(const ContentType& contentType)
    6867{
    6968    if (contentType.isEmpty())
     
    7372}
    7473
    75 bool AVFoundationMIMETypeCache::canDecodeType(const String& mimeType)
     74bool AVAssetMIMETypeCache::canDecodeType(const String& mimeType)
    7675{
    7776    if (mimeType.isEmpty())
     
    8887}
    8988
    90 bool AVFoundationMIMETypeCache::isAvailable() const
     89bool AVAssetMIMETypeCache::isAvailable() const
    9190{
    9291#if ENABLE(VIDEO) && USE(AVFOUNDATION)
     
    103102}
    104103
    105 void AVFoundationMIMETypeCache::loadMIMETypes()
     104void AVAssetMIMETypeCache::loadMIMETypes()
    106105{
    107106    m_cache = HashSet<String, ASCIICaseInsensitiveHash>();
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm

    r244704 r244980  
    2929#if HAVE(AVASSETREADER)
    3030
    31 #import "AVFoundationMIMETypeCache.h"
     31#import "AVAssetMIMETypeCache.h"
    3232#import "AffineTransform.h"
    3333#import "ContentType.h"
     
    338338{
    339339    // AVFoundation may not be available at runtime.
    340     if (!AVFoundationMIMETypeCache::singleton().isAvailable())
     340    if (!AVAssetMIMETypeCache::singleton().isAvailable())
    341341        return nullptr;
    342342
     
    369369bool ImageDecoderAVFObjC::supportsMediaType(MediaType type)
    370370{
    371     return type == MediaType::Video && AVFoundationMIMETypeCache::singleton().isAvailable();
     371    return type == MediaType::Video && AVAssetMIMETypeCache::singleton().isAvailable();
    372372}
    373373
    374374bool ImageDecoderAVFObjC::supportsContentType(const ContentType& type)
    375375{
    376     return AVFoundationMIMETypeCache::singleton().supportsContentType(type);
     376    return AVAssetMIMETypeCache::singleton().supportsContentType(type);
    377377}
    378378
    379379bool ImageDecoderAVFObjC::canDecodeType(const String& mimeType)
    380380{
    381     return AVFoundationMIMETypeCache::singleton().canDecodeType(mimeType);
     381    return AVAssetMIMETypeCache::singleton().canDecodeType(mimeType);
    382382}
    383383
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r244922 r244980  
    2929#if ENABLE(VIDEO) && USE(AVFOUNDATION)
    3030
     31#import "AVAssetMIMETypeCache.h"
    3132#import "AVAssetTrackUtilities.h"
    32 #import "AVFoundationMIMETypeCache.h"
    3333#import "AVTrackPrivateAVFObjCImpl.h"
    3434#import "AudioSourceProviderAVFObjC.h"
     
    241241    registrar([](MediaPlayer* player) { return std::make_unique<MediaPlayerPrivateAVFoundationObjC>(player); },
    242242            getSupportedTypes, supportsType, originsInMediaCache, clearMediaCache, clearMediaCacheForOrigins, supportsKeySystem);
    243     ASSERT(AVFoundationMIMETypeCache::singleton().isAvailable());
     243    ASSERT(AVAssetMIMETypeCache::singleton().isAvailable());
    244244}
    245245
     
    15121512void MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& supportedTypes)
    15131513{
    1514     supportedTypes = AVFoundationMIMETypeCache::singleton().types();
    1515 } 
     1514    supportedTypes = AVAssetMIMETypeCache::singleton().types();
     1515}
    15161516
    15171517#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
     
    15391539        return MediaPlayer::IsNotSupported;
    15401540
    1541     if (!staticMIMETypeList().contains(containerType) && !AVFoundationMIMETypeCache::singleton().canDecodeType(containerType))
     1541    if (!staticMIMETypeList().contains(containerType) && !AVAssetMIMETypeCache::singleton().canDecodeType(containerType))
    15421542        return MediaPlayer::IsNotSupported;
    15431543
     
    15681568            return false;
    15691569
    1570         if (!mimeType.isEmpty() && !staticMIMETypeList().contains(mimeType) && !AVFoundationMIMETypeCache::singleton().canDecodeType(mimeType))
     1570        if (!mimeType.isEmpty() && !staticMIMETypeList().contains(mimeType) && !AVAssetMIMETypeCache::singleton().canDecodeType(mimeType))
    15711571            return false;
    15721572
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm

    r244922 r244980  
    2929#if ENABLE(MEDIA_SOURCE) && USE(AVFOUNDATION)
    3030
     31#import "AVAssetMIMETypeCache.h"
    3132#import "AVAssetTrackUtilities.h"
    32 #import "AVFoundationMIMETypeCache.h"
     33#import "AVStreamDataParserMIMETypeCache.h"
    3334#import "CDMSessionAVStreamSession.h"
    3435#import "GraphicsContextCG.h"
     
    175176    registrar([](MediaPlayer* player) { return std::make_unique<MediaPlayerPrivateMediaSourceAVFObjC>(player); },
    176177        getSupportedTypes, supportsType, 0, 0, 0, 0);
    177     ASSERT(AVFoundationMIMETypeCache::singleton().isAvailable());
     178    ASSERT(AVAssetMIMETypeCache::singleton().isAvailable());
    178179}
    179180
     
    190191void MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types)
    191192{
    192     types = AVFoundationMIMETypeCache::singleton().types();
     193    auto& streamDataParserCache = AVStreamDataParserMIMETypeCache::singleton();
     194    if (streamDataParserCache.isAvailable()) {
     195        types = streamDataParserCache.types();
     196        return;
     197    }
     198
     199    auto& assetCache = AVAssetMIMETypeCache::singleton();
     200    if (assetCache.isAvailable())
     201        types = assetCache.types();
    193202}
    194203
     
    203212#endif
    204213
    205     if (parameters.type.isEmpty() || !AVFoundationMIMETypeCache::singleton().canDecodeType(parameters.type.containerType()))
     214    if (parameters.type.isEmpty())
     215        return MediaPlayer::IsNotSupported;
     216
     217    if (AVStreamDataParserMIMETypeCache::singleton().isAvailable()) {
     218        if (!AVStreamDataParserMIMETypeCache::singleton().supportsContentType(parameters.type))
     219            return MediaPlayer::IsNotSupported;
     220    } else if (AVAssetMIMETypeCache::singleton().isAvailable()) {
     221        if (!AVAssetMIMETypeCache::singleton().supportsContentType(parameters.type))
     222            return MediaPlayer::IsNotSupported;
     223    } else
    206224        return MediaPlayer::IsNotSupported;
    207225
     
    212230        return MediaPlayer::MayBeSupported;
    213231
    214     NSString *outputCodecs = codecs;
     232    String outputCodecs = codecs;
    215233    if ([PAL::getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)])
    216234        outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];
     
    219237        return MediaPlayer::IsNotSupported;
    220238
    221     NSString *typeString = [NSString stringWithFormat:@"%@; codecs=\"%@\"", (NSString *)parameters.type.containerType(), (NSString *)outputCodecs];
    222     return [PAL::getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;;
     239    String type = makeString(parameters.type.containerType(), "; codecs=\"", outputCodecs, "\"");
     240    if (AVStreamDataParserMIMETypeCache::singleton().isAvailable())
     241        return AVStreamDataParserMIMETypeCache::singleton().canDecodeType(type) ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;
     242    return AVAssetMIMETypeCache::singleton().canDecodeType(type) ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;
    223243}
    224244
  • trunk/Source/WebKit/ChangeLog

    r244979 r244980  
     12019-05-06  Jer Noble  <jer.noble@apple.com>
     2
     3        Adopt AVStreamDataParser.audiovisualMIMETypes
     4        https://bugs.webkit.org/show_bug.cgi?id=197581
     5        <rdar://problem/50458981>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * WebProcess/cocoa/WebProcessCocoa.mm:
     10        (WebKit::WebProcess::platformInitializeWebProcess):
     11        (WebKit::WebProcess::platformTerminate):
     12        (WebKit::WebProcess::setMediaMIMETypes):
     13
    1142019-05-06  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r244979 r244980  
    5050#import <JavaScriptCore/ConfigFile.h>
    5151#import <JavaScriptCore/Options.h>
    52 #import <WebCore/AVFoundationMIMETypeCache.h>
     52#import <WebCore/AVAssetMIMETypeCache.h>
    5353#import <WebCore/AXObjectCache.h>
    5454#import <WebCore/CPUMonitor.h>
     
    208208        setMediaMIMETypes(parameters.mediaMIMETypes);
    209209    else {
    210         AVFoundationMIMETypeCache::singleton().setCacheMIMETypesCallback([this](const Vector<String>& types) {
     210        AVAssetMIMETypeCache::singleton().setCacheMIMETypesCallback([this](const Vector<String>& types) {
    211211            parentProcessConnection()->send(Messages::WebProcessProxy::CacheMediaMIMETypes(types), 0);
    212212        });
     
    471471void WebProcess::platformTerminate()
    472472{
    473     AVFoundationMIMETypeCache::singleton().setCacheMIMETypesCallback(nullptr);
     473    AVAssetMIMETypeCache::singleton().setCacheMIMETypesCallback(nullptr);
    474474}
    475475
     
    807807void WebProcess::setMediaMIMETypes(const Vector<String> types)
    808808{
    809     AVFoundationMIMETypeCache::singleton().setSupportedTypes(types);
     809    AVAssetMIMETypeCache::singleton().setSupportedTypes(types);
    810810}
    811811
Note: See TracChangeset for help on using the changeset viewer.