Changeset 244980 in webkit
- Timestamp:
- May 6, 2019 3:22:26 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 8 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r244977 r244980 1 2019-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 1 47 2019-05-06 Youenn Fablet <youenn@apple.com> 2 48 -
trunk/Source/WebCore/SourcesCocoa.txt
r244588 r244980 232 232 platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp @no-unify 233 233 234 platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm @no-unify 234 235 platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm @no-unify 235 platform/graphics/avfoundation/objc/AV FoundationMIMETypeCache.mm @no-unify236 platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm @no-unify 236 237 platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm @no-unify 237 238 platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp @no-unify -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r244977 r244980 102 102 070E81D11BF27656001FDA48 /* VideoTrackPrivateMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E81D01BF27656001FDA48 /* VideoTrackPrivateMediaStream.h */; }; 103 103 070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */; }; 104 0719427F1D088F21002AA51D /* AV FoundationMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07C8AD111D073D630087C5CE /* AVFoundationMIMETypeCache.mm */; };104 0719427F1D088F21002AA51D /* AVAssetMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07C8AD111D073D630087C5CE /* AVAssetMIMETypeCache.mm */; }; 105 105 071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 071A9EC0168FB56C002629F9 /* TextTrackCueGeneric.cpp */; }; 106 106 071A9EC3168FBC55002629F9 /* TextTrackCueGeneric.h in Headers */ = {isa = PBXBuildFile; fileRef = 071A9EC1168FB56C002629F9 /* TextTrackCueGeneric.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 228 228 07EE76EF1BEA619800F89133 /* MockRealtimeVideoSourceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76ED1BEA619800F89133 /* MockRealtimeVideoSourceMac.h */; }; 229 229 07F04A942006B1E300AE2A0A /* ApplicationStateChangeListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F04A92200684BC00AE2A0A /* ApplicationStateChangeListener.h */; settings = {ATTRIBUTES = (Private, ); }; }; 230 07F4E93320B3587F002E3803 /* AV FoundationMIMETypeCache.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, ); }; }; 231 231 07F876841AD580F900905849 /* MediaPlaybackTargetContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; 232 232 07F944161864D046005D31CB /* PlatformMediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 3998 3998 CD063F831E23FA8900812BE3 /* InitDataRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = CD063F811E23FA8900812BE3 /* InitDataRegistry.h */; }; 3999 3999 CD0EEE0E14743F39003EAFA2 /* AudioDestinationIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD0EEE0B14743E35003EAFA2 /* AudioDestinationIOS.cpp */; }; 4000 CD11B3E1227CE6F30023AFC7 /* AVStreamDataParserMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD11B3E0227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.mm */; }; 4000 4001 CD127DEE14F3098400E84779 /* WebCoreFullScreenWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4001 4002 CD17A45D213740810079EC7B /* UnifiedSource62-mm.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD17A459213740160079EC7B /* UnifiedSource62-mm.mm */; }; … … 5494 5495 07C1C0E11BFB600100BD2256 /* MediaTrackSupportedConstraints.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaTrackSupportedConstraints.idl; sourceTree = "<group>"; }; 5495 5496 07C1C0E41BFB60ED00BD2256 /* RealtimeMediaSourceSupportedConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RealtimeMediaSourceSupportedConstraints.h; sourceTree = "<group>"; }; 5496 07C8AD111D073D630087C5CE /* AV FoundationMIMETypeCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVFoundationMIMETypeCache.mm; sourceTree = "<group>"; };5497 07C8AD121D073D630087C5CE /* AV FoundationMIMETypeCache.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>"; }; 5498 5499 07CE77D416712A6A00C55A47 /* InbandTextTrackPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandTextTrackPrivateClient.h; sourceTree = "<group>"; }; 5499 5500 07D60924214C5BFB00E7396C /* WindowDisplayCaptureSourceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowDisplayCaptureSourceMac.mm; sourceTree = "<group>"; }; … … 13430 13431 CD0EEE0A14743E34003EAFA2 /* AudioDestinationIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioDestinationIOS.h; sourceTree = "<group>"; }; 13431 13432 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>"; }; 13432 13435 CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenWindow.h; sourceTree = "<group>"; }; 13433 13436 CD127DEB14F3097900E84779 /* WebCoreFullScreenWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFullScreenWindow.mm; sourceTree = "<group>"; }; … … 25921 25924 CDECA8991EDF447D00DCB08B /* AVAssetTrackUtilities.h */, 25922 25925 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 */, 25925 25930 CD78A2EE1F75648600DE371B /* CDMInstanceFairPlayStreamingAVFObjC.h */, 25926 25931 CD78A2EC1F75648600DE371B /* CDMInstanceFairPlayStreamingAVFObjC.mm */, … … 28234 28239 CDC675231EAEA9B700727C84 /* AVAudioSessionCaptureDeviceManager.h in Headers */, 28235 28240 070363E2181A1CDC00C074A5 /* AVCaptureDeviceManager.h in Headers */, 28236 07F4E93320B3587F002E3803 /* AV FoundationMIMETypeCache.h in Headers */,28241 07F4E93320B3587F002E3803 /* AVAssetMIMETypeCache.h in Headers */, 28237 28242 CD336F6217F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h in Headers */, 28238 28243 070363E6181A1CDC00C074A5 /* AVVideoCaptureSource.h in Headers */, … … 32574 32579 CDC675221EAEA9B700727C84 /* AVAudioSessionCaptureDeviceManager.mm in Sources */, 32575 32580 070363E3181A1CDC00C074A5 /* AVCaptureDeviceManager.mm in Sources */, 32576 0719427F1D088F21002AA51D /* AV FoundationMIMETypeCache.mm in Sources */,32581 0719427F1D088F21002AA51D /* AVAssetMIMETypeCache.mm in Sources */, 32577 32582 CD336F6117F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.mm in Sources */, 32578 32583 070363E7181A1CDC00C074A5 /* AVVideoCaptureSource.mm in Sources */, … … 33017 33022 DECA803A1F9FED6A00E3B661 /* UnifiedSource249.cpp in Sources */, 33018 33023 DECA803B1F9FED6A00E3B661 /* UnifiedSource250.cpp in Sources */, 33024 CD11B3E1227CE6F30023AFC7 /* AVStreamDataParserMIMETypeCache.mm in Sources */, 33019 33025 DECA803C1F9FED6A00E3B661 /* UnifiedSource251.cpp in Sources */, 33020 33026 DECA803D1F9FED6A00E3B661 /* UnifiedSource252.cpp in Sources */, -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h
r244979 r244980 36 36 class ContentType; 37 37 38 class AV FoundationMIMETypeCache {38 class AVAssetMIMETypeCache { 39 39 public: 40 WEBCORE_EXPORT static AV FoundationMIMETypeCache& singleton();40 WEBCORE_EXPORT static AVAssetMIMETypeCache& singleton(); 41 41 42 42 bool supportsContentType(const ContentType&); … … 53 53 54 54 private: 55 friend NeverDestroyed<AV FoundationMIMETypeCache>;56 AV FoundationMIMETypeCache() = default;55 friend NeverDestroyed<AVAssetMIMETypeCache>; 56 AVAssetMIMETypeCache() = default; 57 57 58 58 void loadMIMETypes(); -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm
r244979 r244980 25 25 26 26 #import "config.h" 27 #import "AV FoundationMIMETypeCache.h"27 #import "AVAssetMIMETypeCache.h" 28 28 29 29 #if PLATFORM(COCOA) 30 30 31 31 #import "ContentType.h" 32 #import <wtf/HashSet.h>33 34 32 #import <pal/cf/CoreMediaSoftLink.h> 35 33 #import <pal/cocoa/AVFoundationSoftLink.h> 34 #import <wtf/HashSet.h> 36 35 37 36 #if !PLATFORM(IOSMAC) … … 41 40 namespace WebCore { 42 41 43 AV FoundationMIMETypeCache& AVFoundationMIMETypeCache::singleton()42 AVAssetMIMETypeCache& AVAssetMIMETypeCache::singleton() 44 43 { 45 static NeverDestroyed<AV FoundationMIMETypeCache> cache;44 static NeverDestroyed<AVAssetMIMETypeCache> cache; 46 45 return cache.get(); 47 46 } 48 47 49 void AV FoundationMIMETypeCache::setSupportedTypes(const Vector<String>& types)48 void AVAssetMIMETypeCache::setSupportedTypes(const Vector<String>& types) 50 49 { 51 50 if (m_cache) … … 57 56 } 58 57 59 const HashSet<String, ASCIICaseInsensitiveHash>& AV FoundationMIMETypeCache::types()58 const HashSet<String, ASCIICaseInsensitiveHash>& AVAssetMIMETypeCache::types() 60 59 { 61 60 if (!m_cache) … … 65 64 } 66 65 67 bool AV FoundationMIMETypeCache::supportsContentType(const ContentType& contentType)66 bool AVAssetMIMETypeCache::supportsContentType(const ContentType& contentType) 68 67 { 69 68 if (contentType.isEmpty()) … … 73 72 } 74 73 75 bool AV FoundationMIMETypeCache::canDecodeType(const String& mimeType)74 bool AVAssetMIMETypeCache::canDecodeType(const String& mimeType) 76 75 { 77 76 if (mimeType.isEmpty()) … … 88 87 } 89 88 90 bool AV FoundationMIMETypeCache::isAvailable() const89 bool AVAssetMIMETypeCache::isAvailable() const 91 90 { 92 91 #if ENABLE(VIDEO) && USE(AVFOUNDATION) … … 103 102 } 104 103 105 void AV FoundationMIMETypeCache::loadMIMETypes()104 void AVAssetMIMETypeCache::loadMIMETypes() 106 105 { 107 106 m_cache = HashSet<String, ASCIICaseInsensitiveHash>(); -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm
r244704 r244980 29 29 #if HAVE(AVASSETREADER) 30 30 31 #import "AV FoundationMIMETypeCache.h"31 #import "AVAssetMIMETypeCache.h" 32 32 #import "AffineTransform.h" 33 33 #import "ContentType.h" … … 338 338 { 339 339 // AVFoundation may not be available at runtime. 340 if (!AV FoundationMIMETypeCache::singleton().isAvailable())340 if (!AVAssetMIMETypeCache::singleton().isAvailable()) 341 341 return nullptr; 342 342 … … 369 369 bool ImageDecoderAVFObjC::supportsMediaType(MediaType type) 370 370 { 371 return type == MediaType::Video && AV FoundationMIMETypeCache::singleton().isAvailable();371 return type == MediaType::Video && AVAssetMIMETypeCache::singleton().isAvailable(); 372 372 } 373 373 374 374 bool ImageDecoderAVFObjC::supportsContentType(const ContentType& type) 375 375 { 376 return AV FoundationMIMETypeCache::singleton().supportsContentType(type);376 return AVAssetMIMETypeCache::singleton().supportsContentType(type); 377 377 } 378 378 379 379 bool ImageDecoderAVFObjC::canDecodeType(const String& mimeType) 380 380 { 381 return AV FoundationMIMETypeCache::singleton().canDecodeType(mimeType);381 return AVAssetMIMETypeCache::singleton().canDecodeType(mimeType); 382 382 } 383 383 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r244922 r244980 29 29 #if ENABLE(VIDEO) && USE(AVFOUNDATION) 30 30 31 #import "AVAssetMIMETypeCache.h" 31 32 #import "AVAssetTrackUtilities.h" 32 #import "AVFoundationMIMETypeCache.h"33 33 #import "AVTrackPrivateAVFObjCImpl.h" 34 34 #import "AudioSourceProviderAVFObjC.h" … … 241 241 registrar([](MediaPlayer* player) { return std::make_unique<MediaPlayerPrivateAVFoundationObjC>(player); }, 242 242 getSupportedTypes, supportsType, originsInMediaCache, clearMediaCache, clearMediaCacheForOrigins, supportsKeySystem); 243 ASSERT(AV FoundationMIMETypeCache::singleton().isAvailable());243 ASSERT(AVAssetMIMETypeCache::singleton().isAvailable()); 244 244 } 245 245 … … 1512 1512 void MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& supportedTypes) 1513 1513 { 1514 supportedTypes = AV FoundationMIMETypeCache::singleton().types();1515 } 1514 supportedTypes = AVAssetMIMETypeCache::singleton().types(); 1515 } 1516 1516 1517 1517 #if ENABLE(LEGACY_ENCRYPTED_MEDIA) … … 1539 1539 return MediaPlayer::IsNotSupported; 1540 1540 1541 if (!staticMIMETypeList().contains(containerType) && !AV FoundationMIMETypeCache::singleton().canDecodeType(containerType))1541 if (!staticMIMETypeList().contains(containerType) && !AVAssetMIMETypeCache::singleton().canDecodeType(containerType)) 1542 1542 return MediaPlayer::IsNotSupported; 1543 1543 … … 1568 1568 return false; 1569 1569 1570 if (!mimeType.isEmpty() && !staticMIMETypeList().contains(mimeType) && !AV FoundationMIMETypeCache::singleton().canDecodeType(mimeType))1570 if (!mimeType.isEmpty() && !staticMIMETypeList().contains(mimeType) && !AVAssetMIMETypeCache::singleton().canDecodeType(mimeType)) 1571 1571 return false; 1572 1572 -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
r244922 r244980 29 29 #if ENABLE(MEDIA_SOURCE) && USE(AVFOUNDATION) 30 30 31 #import "AVAssetMIMETypeCache.h" 31 32 #import "AVAssetTrackUtilities.h" 32 #import "AV FoundationMIMETypeCache.h"33 #import "AVStreamDataParserMIMETypeCache.h" 33 34 #import "CDMSessionAVStreamSession.h" 34 35 #import "GraphicsContextCG.h" … … 175 176 registrar([](MediaPlayer* player) { return std::make_unique<MediaPlayerPrivateMediaSourceAVFObjC>(player); }, 176 177 getSupportedTypes, supportsType, 0, 0, 0, 0); 177 ASSERT(AV FoundationMIMETypeCache::singleton().isAvailable());178 ASSERT(AVAssetMIMETypeCache::singleton().isAvailable()); 178 179 } 179 180 … … 190 191 void MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) 191 192 { 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(); 193 202 } 194 203 … … 203 212 #endif 204 213 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 206 224 return MediaPlayer::IsNotSupported; 207 225 … … 212 230 return MediaPlayer::MayBeSupported; 213 231 214 NSString *outputCodecs = codecs;232 String outputCodecs = codecs; 215 233 if ([PAL::getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)]) 216 234 outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs]; … … 219 237 return MediaPlayer::IsNotSupported; 220 238 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; 223 243 } 224 244 -
trunk/Source/WebKit/ChangeLog
r244979 r244980 1 2019-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 1 14 2019-05-06 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
r244979 r244980 50 50 #import <JavaScriptCore/ConfigFile.h> 51 51 #import <JavaScriptCore/Options.h> 52 #import <WebCore/AV FoundationMIMETypeCache.h>52 #import <WebCore/AVAssetMIMETypeCache.h> 53 53 #import <WebCore/AXObjectCache.h> 54 54 #import <WebCore/CPUMonitor.h> … … 208 208 setMediaMIMETypes(parameters.mediaMIMETypes); 209 209 else { 210 AV FoundationMIMETypeCache::singleton().setCacheMIMETypesCallback([this](const Vector<String>& types) {210 AVAssetMIMETypeCache::singleton().setCacheMIMETypesCallback([this](const Vector<String>& types) { 211 211 parentProcessConnection()->send(Messages::WebProcessProxy::CacheMediaMIMETypes(types), 0); 212 212 }); … … 471 471 void WebProcess::platformTerminate() 472 472 { 473 AV FoundationMIMETypeCache::singleton().setCacheMIMETypesCallback(nullptr);473 AVAssetMIMETypeCache::singleton().setCacheMIMETypesCallback(nullptr); 474 474 } 475 475 … … 807 807 void WebProcess::setMediaMIMETypes(const Vector<String> types) 808 808 { 809 AV FoundationMIMETypeCache::singleton().setSupportedTypes(types);809 AVAssetMIMETypeCache::singleton().setSupportedTypes(types); 810 810 } 811 811
Note: See TracChangeset
for help on using the changeset viewer.