WebKit Bugzilla
Attachment 369005 Details for
Bug 197581
: Adopt AVStreamDataParser.audiovisualMIMETypes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
0001-Adopt-AVStreamDataParser.audiovisualMIMETypes.patch (text/plain), 41.32 KB, created by
Jer Noble
on 2019-05-03 15:31:03 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2019-05-03 15:31:03 PDT
Size:
41.32 KB
patch
obsolete
>From 7158708f9d57505db93025f14d51940867abd311 Mon Sep 17 00:00:00 2001 >From: Jer Noble <jer.noble@apple.com> >Date: Fri, 3 May 2019 15:15:22 -0700 >Subject: Adopt AVStreamDataParser.audiovisualMIMETypes > https://bugs.webkit.org/show_bug.cgi?id=197581 <rdar://problem/50458981> > >Reviewed by NOBODY (OOPS!). > >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): >--- > Source/WebCore/ChangeLog | 46 +++++++ > Source/WebCore/SourcesCocoa.txt | 3 +- > .../WebCore/WebCore.xcodeproj/project.pbxproj | 22 +-- > ...MIMETypeCache.h => AVAssetMIMETypeCache.h} | 8 +- > ...METypeCache.mm => AVAssetMIMETypeCache.mm} | 21 ++- > .../objc/AVStreamDataParserMIMETypeCache.h | 60 +++++++++ > .../objc/AVStreamDataParserMIMETypeCache.mm | 127 ++++++++++++++++++ > .../avfoundation/objc/ImageDecoderAVFObjC.mm | 10 +- > .../MediaPlayerPrivateAVFoundationObjC.mm | 12 +- > .../MediaPlayerPrivateMediaSourceAVFObjC.mm | 34 ++++- > Source/WebKit/ChangeLog | 13 ++ > .../WebProcess/cocoa/WebProcessCocoa.mm | 8 +- > 12 files changed, 318 insertions(+), 46 deletions(-) > rename Source/WebCore/platform/graphics/avfoundation/objc/{AVFoundationMIMETypeCache.h => AVAssetMIMETypeCache.h} (91%) > rename Source/WebCore/platform/graphics/avfoundation/objc/{AVFoundationMIMETypeCache.mm => AVAssetMIMETypeCache.mm} (84%) > create mode 100644 Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h > create mode 100644 Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index da6bd98068f..72e7ba48f7e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,49 @@ >+2019-05-03 Jer Noble <jer.noble@apple.com> >+ >+ Adopt AVStreamDataParser.audiovisualMIMETypes >+ https://bugs.webkit.org/show_bug.cgi?id=197581 >+ <rdar://problem/50458981> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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): >+ > 2019-05-01 Jer Noble <jer.noble@apple.com> > > Hide MediaCapabilities.encodingInfo() when the platform does not support it. >diff --git a/Source/WebCore/SourcesCocoa.txt b/Source/WebCore/SourcesCocoa.txt >index 3e0ec4c1dc5..c081198a172 100644 >--- a/Source/WebCore/SourcesCocoa.txt >+++ b/Source/WebCore/SourcesCocoa.txt >@@ -231,8 +231,9 @@ platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp @no-unify > platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm @no-unify > platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp @no-unify > >+platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm @no-unify > platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm @no-unify >-platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm @no-unify >+platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm @no-unify > platform/graphics/avfoundation/objc/AudioTrackPrivateAVFObjC.mm @no-unify > platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.cpp @no-unify > platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm @no-unify >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 9c18885e851..4599d7ff0e7 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -101,7 +101,7 @@ > 070E09191875EEFC003A1D3C /* PlatformMediaSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E09181875ED93003A1D3C /* PlatformMediaSession.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 070E81D11BF27656001FDA48 /* VideoTrackPrivateMediaStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 070E81D01BF27656001FDA48 /* VideoTrackPrivateMediaStream.h */; }; > 070F549817F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549717F12F6B00169E04 /* MediaStreamConstraintsValidationClient.h */; }; >- 0719427F1D088F21002AA51D /* AVFoundationMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07C8AD111D073D630087C5CE /* AVFoundationMIMETypeCache.mm */; }; >+ 0719427F1D088F21002AA51D /* AVAssetMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 07C8AD111D073D630087C5CE /* AVAssetMIMETypeCache.mm */; }; > 071A9EC2168FBC43002629F9 /* TextTrackCueGeneric.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 071A9EC0168FB56C002629F9 /* TextTrackCueGeneric.cpp */; }; > 071A9EC3168FBC55002629F9 /* TextTrackCueGeneric.h in Headers */ = {isa = PBXBuildFile; fileRef = 071A9EC1168FB56C002629F9 /* TextTrackCueGeneric.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 071E496E1AD5AA0D008A50B4 /* MediaPlaybackTargetMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 071E496D1AD5AA0D008A50B4 /* MediaPlaybackTargetMac.mm */; }; >@@ -227,7 +227,7 @@ > 07EE76EC1BE96DB000F89133 /* MockRealtimeVideoSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76EA1BE96DB000F89133 /* MockRealtimeVideoSource.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 07EE76EF1BEA619800F89133 /* MockRealtimeVideoSourceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 07EE76ED1BEA619800F89133 /* MockRealtimeVideoSourceMac.h */; }; > 07F04A942006B1E300AE2A0A /* ApplicationStateChangeListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F04A92200684BC00AE2A0A /* ApplicationStateChangeListener.h */; settings = {ATTRIBUTES = (Private, ); }; }; >- 07F4E93320B3587F002E3803 /* AVFoundationMIMETypeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C8AD121D073D630087C5CE /* AVFoundationMIMETypeCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 07F4E93320B3587F002E3803 /* AVAssetMIMETypeCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 07C8AD121D073D630087C5CE /* AVAssetMIMETypeCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 07F876841AD580F900905849 /* MediaPlaybackTargetContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 07F876831AD4A94500905849 /* MediaPlaybackTargetContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 07F944161864D046005D31CB /* PlatformMediaSessionManager.h in Headers */ = {isa = PBXBuildFile; fileRef = CDAE8C081746B95700532D78 /* PlatformMediaSessionManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 07FE99DD18807A7D00256648 /* MediaElementSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 07FE99DB18807A7D00256648 /* MediaElementSession.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -3997,6 +3997,7 @@ > CD063F821E23FA8900812BE3 /* InitDataRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD063F801E23FA8900812BE3 /* InitDataRegistry.cpp */; }; > CD063F831E23FA8900812BE3 /* InitDataRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = CD063F811E23FA8900812BE3 /* InitDataRegistry.h */; }; > CD0EEE0E14743F39003EAFA2 /* AudioDestinationIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD0EEE0B14743E35003EAFA2 /* AudioDestinationIOS.cpp */; }; >+ CD11B3E1227CE6F30023AFC7 /* AVStreamDataParserMIMETypeCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD11B3E0227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.mm */; }; > CD127DEE14F3098400E84779 /* WebCoreFullScreenWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */; settings = {ATTRIBUTES = (Private, ); }; }; > CD17A45D213740810079EC7B /* UnifiedSource62-mm.mm in Sources */ = {isa = PBXBuildFile; fileRef = CD17A459213740160079EC7B /* UnifiedSource62-mm.mm */; }; > CD19A2681A13E700008D650E /* DiagnosticLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CD19A2671A13E700008D650E /* DiagnosticLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -5493,8 +5494,8 @@ > 07C1C0E01BFB600100BD2256 /* MediaTrackSupportedConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTrackSupportedConstraints.h; sourceTree = "<group>"; }; > 07C1C0E11BFB600100BD2256 /* MediaTrackSupportedConstraints.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = MediaTrackSupportedConstraints.idl; sourceTree = "<group>"; }; > 07C1C0E41BFB60ED00BD2256 /* RealtimeMediaSourceSupportedConstraints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RealtimeMediaSourceSupportedConstraints.h; sourceTree = "<group>"; }; >- 07C8AD111D073D630087C5CE /* AVFoundationMIMETypeCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVFoundationMIMETypeCache.mm; sourceTree = "<group>"; }; >- 07C8AD121D073D630087C5CE /* AVFoundationMIMETypeCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVFoundationMIMETypeCache.h; sourceTree = "<group>"; }; >+ 07C8AD111D073D630087C5CE /* AVAssetMIMETypeCache.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AVAssetMIMETypeCache.mm; sourceTree = "<group>"; }; >+ 07C8AD121D073D630087C5CE /* AVAssetMIMETypeCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AVAssetMIMETypeCache.h; sourceTree = "<group>"; }; > 07CE77D416712A6A00C55A47 /* InbandTextTrackPrivateClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InbandTextTrackPrivateClient.h; sourceTree = "<group>"; }; > 07D60924214C5BFB00E7396C /* WindowDisplayCaptureSourceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowDisplayCaptureSourceMac.mm; sourceTree = "<group>"; }; > 07D60926214C5BFC00E7396C /* WindowDisplayCaptureSourceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowDisplayCaptureSourceMac.h; sourceTree = "<group>"; }; >@@ -13429,6 +13430,8 @@ > CD0C8B582141C8CA0062F59D /* MediaCapabilitiesInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MediaCapabilitiesInfo.h; sourceTree = "<group>"; }; > CD0EEE0A14743E34003EAFA2 /* AudioDestinationIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioDestinationIOS.h; sourceTree = "<group>"; }; > CD0EEE0B14743E35003EAFA2 /* AudioDestinationIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudioDestinationIOS.cpp; sourceTree = "<group>"; }; >+ CD11B3DF227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AVStreamDataParserMIMETypeCache.h; sourceTree = "<group>"; }; >+ CD11B3E0227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AVStreamDataParserMIMETypeCache.mm; sourceTree = "<group>"; }; > CD127DEA14F3097900E84779 /* WebCoreFullScreenWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreFullScreenWindow.h; sourceTree = "<group>"; }; > CD127DEB14F3097900E84779 /* WebCoreFullScreenWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreFullScreenWindow.mm; sourceTree = "<group>"; }; > CD17A459213740160079EC7B /* UnifiedSource62-mm.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = "UnifiedSource62-mm.mm"; path = "DerivedSources/WebCore/unified-sources/UnifiedSource62-mm.mm"; sourceTree = BUILT_PRODUCTS_DIR; }; >@@ -25922,8 +25925,10 @@ > CD54A761180F9F7000B076C9 /* AudioTrackPrivateMediaSourceAVFObjC.h */, > CDECA8991EDF447D00DCB08B /* AVAssetTrackUtilities.h */, > CDECA8981EDF447D00DCB08B /* AVAssetTrackUtilities.mm */, >- 07C8AD121D073D630087C5CE /* AVFoundationMIMETypeCache.h */, >- 07C8AD111D073D630087C5CE /* AVFoundationMIMETypeCache.mm */, >+ 07C8AD121D073D630087C5CE /* AVAssetMIMETypeCache.h */, >+ 07C8AD111D073D630087C5CE /* AVAssetMIMETypeCache.mm */, >+ CD11B3DF227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.h */, >+ CD11B3E0227CAAA90023AFC7 /* AVStreamDataParserMIMETypeCache.mm */, > CD78A2EE1F75648600DE371B /* CDMInstanceFairPlayStreamingAVFObjC.h */, > CD78A2EC1F75648600DE371B /* CDMInstanceFairPlayStreamingAVFObjC.mm */, > CDE595941BF166D100A1CBE8 /* CDMSessionAVContentKeySession.h */, >@@ -28235,7 +28240,7 @@ > CDC675271EAEA9D400727C84 /* AVAudioSessionCaptureDevice.h in Headers */, > CDC675231EAEA9B700727C84 /* AVAudioSessionCaptureDeviceManager.h in Headers */, > 070363E2181A1CDC00C074A5 /* AVCaptureDeviceManager.h in Headers */, >- 07F4E93320B3587F002E3803 /* AVFoundationMIMETypeCache.h in Headers */, >+ 07F4E93320B3587F002E3803 /* AVAssetMIMETypeCache.h in Headers */, > CD336F6217F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.h in Headers */, > 070363E6181A1CDC00C074A5 /* AVVideoCaptureSource.h in Headers */, > 29AE212D21AB9EEB00869283 /* AXIsolatedTree.h in Headers */, >@@ -32575,7 +32580,7 @@ > CDECA89A1EDF447D00DCB08B /* AVAssetTrackUtilities.mm in Sources */, > CDC675221EAEA9B700727C84 /* AVAudioSessionCaptureDeviceManager.mm in Sources */, > 070363E3181A1CDC00C074A5 /* AVCaptureDeviceManager.mm in Sources */, >- 0719427F1D088F21002AA51D /* AVFoundationMIMETypeCache.mm in Sources */, >+ 0719427F1D088F21002AA51D /* AVAssetMIMETypeCache.mm in Sources */, > CD336F6117F9F64700DDDCD0 /* AVTrackPrivateAVFObjCImpl.mm in Sources */, > 070363E7181A1CDC00C074A5 /* AVVideoCaptureSource.mm in Sources */, > 7A45032F18DB717200377B34 /* BufferedLineReader.cpp in Sources */, >@@ -33018,6 +33023,7 @@ > DECA80391F9FED6A00E3B661 /* UnifiedSource248.cpp in Sources */, > DECA803A1F9FED6A00E3B661 /* UnifiedSource249.cpp in Sources */, > DECA803B1F9FED6A00E3B661 /* UnifiedSource250.cpp in Sources */, >+ CD11B3E1227CE6F30023AFC7 /* AVStreamDataParserMIMETypeCache.mm in Sources */, > DECA803C1F9FED6A00E3B661 /* UnifiedSource251.cpp in Sources */, > DECA803D1F9FED6A00E3B661 /* UnifiedSource252.cpp in Sources */, > DECA803E1F9FED6A00E3B661 /* UnifiedSource253.cpp in Sources */, >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h b/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h >similarity index 91% >rename from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h >rename to Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h >index 58f52e2c604..d6d92acb05a 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.h >@@ -35,9 +35,9 @@ namespace WebCore { > > class ContentType; > >-class AVFoundationMIMETypeCache { >+class AVAssetMIMETypeCache { > public: >- WEBCORE_EXPORT static AVFoundationMIMETypeCache& singleton(); >+ WEBCORE_EXPORT static AVAssetMIMETypeCache& singleton(); > > bool supportsContentType(const ContentType&); > bool canDecodeType(const String&); >@@ -52,8 +52,8 @@ public: > WEBCORE_EXPORT void setSupportedTypes(const Vector<String>&); > > private: >- friend NeverDestroyed<AVFoundationMIMETypeCache>; >- AVFoundationMIMETypeCache() = default; >+ friend NeverDestroyed<AVAssetMIMETypeCache>; >+ AVAssetMIMETypeCache() = default; > > void loadMIMETypes(); > >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm b/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm >similarity index 84% >rename from Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm >rename to Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm >index 5a7bf691dda..6468b6b7d0a 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm >@@ -24,15 +24,14 @@ > */ > > #import "config.h" >-#import "AVFoundationMIMETypeCache.h" >+#import "AVAssetMIMETypeCache.h" > > #if PLATFORM(COCOA) > > #import "ContentType.h" >-#import <wtf/HashSet.h> >- > #import <pal/cf/CoreMediaSoftLink.h> > #import <pal/cocoa/AVFoundationSoftLink.h> >+#import <wtf/HashSet.h> > > #if !PLATFORM(IOSMAC) > SOFT_LINK_FRAMEWORK_OPTIONAL_PREFLIGHT(AVFoundation) >@@ -40,13 +39,13 @@ SOFT_LINK_FRAMEWORK_OPTIONAL_PREFLIGHT(AVFoundation) > > namespace WebCore { > >-AVFoundationMIMETypeCache& AVFoundationMIMETypeCache::singleton() >+AVAssetMIMETypeCache& AVAssetMIMETypeCache::singleton() > { >- static NeverDestroyed<AVFoundationMIMETypeCache> cache; >+ static NeverDestroyed<AVAssetMIMETypeCache> cache; > return cache.get(); > } > >-void AVFoundationMIMETypeCache::setSupportedTypes(const Vector<String>& types) >+void AVAssetMIMETypeCache::setSupportedTypes(const Vector<String>& types) > { > if (m_cache) > return; >@@ -56,7 +55,7 @@ void AVFoundationMIMETypeCache::setSupportedTypes(const Vector<String>& types) > m_cache->add(type); > } > >-const HashSet<String, ASCIICaseInsensitiveHash>& AVFoundationMIMETypeCache::types() >+const HashSet<String, ASCIICaseInsensitiveHash>& AVAssetMIMETypeCache::types() > { > if (!m_cache) > loadMIMETypes(); >@@ -64,7 +63,7 @@ const HashSet<String, ASCIICaseInsensitiveHash>& AVFoundationMIMETypeCache::type > return *m_cache; > } > >-bool AVFoundationMIMETypeCache::supportsContentType(const ContentType& contentType) >+bool AVAssetMIMETypeCache::supportsContentType(const ContentType& contentType) > { > if (contentType.isEmpty()) > return false; >@@ -72,7 +71,7 @@ bool AVFoundationMIMETypeCache::supportsContentType(const ContentType& contentTy > return types().contains(contentType.containerType()); > } > >-bool AVFoundationMIMETypeCache::canDecodeType(const String& mimeType) >+bool AVAssetMIMETypeCache::canDecodeType(const String& mimeType) > { > if (mimeType.isEmpty()) > return false; >@@ -87,7 +86,7 @@ bool AVFoundationMIMETypeCache::canDecodeType(const String& mimeType) > return false; > } > >-bool AVFoundationMIMETypeCache::isAvailable() const >+bool AVAssetMIMETypeCache::isAvailable() const > { > #if ENABLE(VIDEO) && USE(AVFOUNDATION) > #if PLATFORM(IOSMAC) >@@ -102,7 +101,7 @@ bool AVFoundationMIMETypeCache::isAvailable() const > #endif > } > >-void AVFoundationMIMETypeCache::loadMIMETypes() >+void AVAssetMIMETypeCache::loadMIMETypes() > { > m_cache = HashSet<String, ASCIICaseInsensitiveHash>(); > >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h b/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h >new file mode 100644 >index 00000000000..0abcc3d21ac >--- /dev/null >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.h >@@ -0,0 +1,60 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if PLATFORM(COCOA) >+ >+#include <wtf/Forward.h> >+#include <wtf/HashSet.h> >+#include <wtf/text/StringHash.h> >+ >+namespace WebCore { >+ >+class ContentType; >+ >+class AVStreamDataParserMIMETypeCache { >+public: >+ WEBCORE_EXPORT static AVStreamDataParserMIMETypeCache& singleton(); >+ >+ bool supportsContentType(const ContentType&); >+ bool canDecodeType(const String&); >+ >+ const HashSet<String, ASCIICaseInsensitiveHash>& types(); >+ bool isEmpty(); >+ bool isAvailable() const; >+ >+private: >+ friend NeverDestroyed<AVStreamDataParserMIMETypeCache>; >+ AVStreamDataParserMIMETypeCache() = default; >+ >+ void loadMIMETypes(); >+ >+ Optional<HashSet<String, ASCIICaseInsensitiveHash>> m_cache; >+}; >+ >+} >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm b/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm >new file mode 100644 >index 00000000000..9c3bddecf91 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm >@@ -0,0 +1,127 @@ >+/* >+ * Copyright (C) 2019 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "AVStreamDataParserMIMETypeCache.h" >+ >+#if PLATFORM(COCOA) >+ >+#import "AVAssetMIMETypeCache.h" >+#import "ContentType.h" >+#import <pal/cf/CoreMediaSoftLink.h> >+#import <pal/cocoa/AVFoundationSoftLink.h> >+#import <wtf/HashSet.h> >+ >+#if !PLATFORM(IOSMAC) >+SOFT_LINK_FRAMEWORK_OPTIONAL_PREFLIGHT(AVFoundation) >+#endif >+ >+namespace WebCore { >+ >+AVStreamDataParserMIMETypeCache& AVStreamDataParserMIMETypeCache::singleton() >+{ >+ static NeverDestroyed<AVStreamDataParserMIMETypeCache> cache; >+ return cache.get(); >+} >+ >+const HashSet<String, ASCIICaseInsensitiveHash>& AVStreamDataParserMIMETypeCache::types() >+{ >+ if (!m_cache) >+ loadMIMETypes(); >+ >+ return *m_cache; >+} >+ >+bool AVStreamDataParserMIMETypeCache::supportsContentType(const ContentType& contentType) >+{ >+ if (contentType.isEmpty()) >+ return false; >+ >+ return types().contains(contentType.containerType()); >+} >+ >+bool AVStreamDataParserMIMETypeCache::canDecodeType(const String& mimeType) >+{ >+ if (mimeType.isEmpty()) >+ return false; >+ >+ ContentType type { mimeType }; >+ >+ if (!isAvailable() || !types().contains(type.containerType())) >+ return false; >+ >+#if ENABLE(VIDEO) && USE(AVFOUNDATION) >+ // AVStreamDataParser does not have an -isPlayableExtendedMIMEType: method, so just replace the container type >+ // with a valid one from AVAssetMIMETypeCache and ask that cache if it can decode this type: >+ auto& assetCache = AVAssetMIMETypeCache::singleton(); >+ if (!assetCache.isAvailable() || assetCache.types().isEmpty()) >+ return false; >+ ContentType originalType { mimeType }; >+ String replacementType { mimeType }; >+ replacementType.replace(originalType.containerType(), *assetCache.types().begin()); >+ return assetCache.canDecodeType(replacementType); >+#endif >+ >+ return false; >+} >+ >+bool AVStreamDataParserMIMETypeCache::isAvailable() const >+{ >+#if ENABLE(VIDEO) && USE(AVFOUNDATION) >+#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. >+ if (!PAL::AVFoundationLibrary()) >+ return false; >+#else >+ if (!AVFoundationLibraryIsAvailable()) >+ return false; >+#endif >+ >+ return [PAL::getAVStreamDataParserClass() respondsToSelector:@selector(audiovisualMIMETypes)]; >+#else >+ return false; >+#endif >+} >+ >+void AVStreamDataParserMIMETypeCache::loadMIMETypes() >+{ >+ m_cache = HashSet<String, ASCIICaseInsensitiveHash>(); >+ >+#if ENABLE(VIDEO) && USE(AVFOUNDATION) >+ static std::once_flag onceFlag; >+ std::call_once(onceFlag, [this] { >+ if (!isAvailable()) >+ return; >+ >+ for (NSString* type in [PAL::getAVStreamDataParserClass() audiovisualMIMETypes]) >+ m_cache->add(type); >+ }); >+#endif >+} >+ >+} >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm >index d3f547f99c4..5fbf505af7c 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm >@@ -28,7 +28,7 @@ > > #if HAVE(AVASSETREADER) > >-#import "AVFoundationMIMETypeCache.h" >+#import "AVAssetMIMETypeCache.h" > #import "AffineTransform.h" > #import "ContentType.h" > #import "FloatQuad.h" >@@ -337,7 +337,7 @@ ImageDecoderAVFObjCSample* toSample(Iterator iter) > RefPtr<ImageDecoderAVFObjC> ImageDecoderAVFObjC::create(SharedBuffer& data, const String& mimeType, AlphaOption alphaOption, GammaAndColorProfileOption gammaAndColorProfileOption) > { > // AVFoundation may not be available at runtime. >- if (!AVFoundationMIMETypeCache::singleton().isAvailable()) >+ if (!AVAssetMIMETypeCache::singleton().isAvailable()) > return nullptr; > > if (!canLoad_VideoToolbox_VTCreateCGImageFromCVPixelBuffer()) >@@ -368,17 +368,17 @@ ImageDecoderAVFObjC::~ImageDecoderAVFObjC() = default; > > bool ImageDecoderAVFObjC::supportsMediaType(MediaType type) > { >- return type == MediaType::Video && AVFoundationMIMETypeCache::singleton().isAvailable(); >+ return type == MediaType::Video && AVAssetMIMETypeCache::singleton().isAvailable(); > } > > bool ImageDecoderAVFObjC::supportsContentType(const ContentType& type) > { >- return AVFoundationMIMETypeCache::singleton().supportsContentType(type); >+ return AVAssetMIMETypeCache::singleton().supportsContentType(type); > } > > bool ImageDecoderAVFObjC::canDecodeType(const String& mimeType) > { >- return AVFoundationMIMETypeCache::singleton().canDecodeType(mimeType); >+ return AVAssetMIMETypeCache::singleton().canDecodeType(mimeType); > } > > AVAssetTrack *ImageDecoderAVFObjC::firstEnabledTrack() >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >index 4e5b82372e9..da0c2e88e55 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >@@ -28,8 +28,8 @@ > > #if ENABLE(VIDEO) && USE(AVFOUNDATION) > >+#import "AVAssetMIMETypeCache.h" > #import "AVAssetTrackUtilities.h" >-#import "AVFoundationMIMETypeCache.h" > #import "AVTrackPrivateAVFObjCImpl.h" > #import "AudioSourceProviderAVFObjC.h" > #import "AudioTrackPrivateAVFObjC.h" >@@ -240,7 +240,7 @@ void MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(MediaEngineRegistra > > registrar([](MediaPlayer* player) { return std::make_unique<MediaPlayerPrivateAVFoundationObjC>(player); }, > getSupportedTypes, supportsType, originsInMediaCache, clearMediaCache, clearMediaCacheForOrigins, supportsKeySystem); >- ASSERT(AVFoundationMIMETypeCache::singleton().isAvailable()); >+ ASSERT(AVAssetMIMETypeCache::singleton().isAvailable()); > } > > static AVAssetCache *assetCacheForPath(const String& path) >@@ -1511,8 +1511,8 @@ RetainPtr<CGImageRef> MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRe > > void MediaPlayerPrivateAVFoundationObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& supportedTypes) > { >- supportedTypes = AVFoundationMIMETypeCache::singleton().types(); >-} >+ supportedTypes = AVAssetMIMETypeCache::singleton().types(); >+} > > #if ENABLE(LEGACY_ENCRYPTED_MEDIA) > static bool keySystemIsSupported(const String& keySystem) >@@ -1538,7 +1538,7 @@ MediaPlayer::SupportsType MediaPlayerPrivateAVFoundationObjC::supportsType(const > if (isUnsupportedMIMEType(containerType)) > return MediaPlayer::IsNotSupported; > >- if (!staticMIMETypeList().contains(containerType) && !AVFoundationMIMETypeCache::singleton().canDecodeType(containerType)) >+ if (!staticMIMETypeList().contains(containerType) && !AVAssetMIMETypeCache::singleton().canDecodeType(containerType)) > return MediaPlayer::IsNotSupported; > > // The spec says: >@@ -1567,7 +1567,7 @@ bool MediaPlayerPrivateAVFoundationObjC::supportsKeySystem(const String& keySyst > if (!mimeType.isEmpty() && isUnsupportedMIMEType(mimeType)) > return false; > >- if (!mimeType.isEmpty() && !staticMIMETypeList().contains(mimeType) && !AVFoundationMIMETypeCache::singleton().canDecodeType(mimeType)) >+ if (!mimeType.isEmpty() && !staticMIMETypeList().contains(mimeType) && !AVAssetMIMETypeCache::singleton().canDecodeType(mimeType)) > return false; > > return true; >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >index 7fb1a5ec305..66385ecc41c 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >@@ -28,8 +28,9 @@ > > #if ENABLE(MEDIA_SOURCE) && USE(AVFOUNDATION) > >+#import "AVAssetMIMETypeCache.h" > #import "AVAssetTrackUtilities.h" >-#import "AVFoundationMIMETypeCache.h" >+#import "AVStreamDataParserMIMETypeCache.h" > #import "CDMSessionAVStreamSession.h" > #import "GraphicsContextCG.h" > #import "Logging.h" >@@ -174,7 +175,7 @@ void MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(MediaEngineRegist > > registrar([](MediaPlayer* player) { return std::make_unique<MediaPlayerPrivateMediaSourceAVFObjC>(player); }, > getSupportedTypes, supportsType, 0, 0, 0, 0); >- ASSERT(AVFoundationMIMETypeCache::singleton().isAvailable()); >+ ASSERT(AVAssetMIMETypeCache::singleton().isAvailable()); > } > > bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable() >@@ -189,7 +190,15 @@ bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable() > > void MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>& types) > { >- types = AVFoundationMIMETypeCache::singleton().types(); >+ auto& streamDataParserCache = AVStreamDataParserMIMETypeCache::singleton(); >+ if (streamDataParserCache.isAvailable()) { >+ types = streamDataParserCache.types(); >+ return; >+ } >+ >+ auto& assetCache = AVAssetMIMETypeCache::singleton(); >+ if (assetCache.isAvailable()) >+ types = assetCache.types(); > } > > MediaPlayer::SupportsType MediaPlayerPrivateMediaSourceAVFObjC::supportsType(const MediaEngineSupportParameters& parameters) >@@ -202,7 +211,16 @@ MediaPlayer::SupportsType MediaPlayerPrivateMediaSourceAVFObjC::supportsType(con > return MediaPlayer::IsNotSupported; > #endif > >- if (parameters.type.isEmpty() || !AVFoundationMIMETypeCache::singleton().canDecodeType(parameters.type.containerType())) >+ if (parameters.type.isEmpty()) >+ return MediaPlayer::IsNotSupported; >+ >+ if (AVStreamDataParserMIMETypeCache::singleton().isAvailable()) { >+ if (!AVStreamDataParserMIMETypeCache::singleton().supportsContentType(parameters.type)) >+ return MediaPlayer::IsNotSupported; >+ } else if (AVAssetMIMETypeCache::singleton().isAvailable()) { >+ if (!AVAssetMIMETypeCache::singleton().supportsContentType(parameters.type)) >+ return MediaPlayer::IsNotSupported; >+ } else > return MediaPlayer::IsNotSupported; > > // The spec says: >@@ -211,15 +229,17 @@ MediaPlayer::SupportsType MediaPlayerPrivateMediaSourceAVFObjC::supportsType(con > if (codecs.isEmpty()) > return MediaPlayer::MayBeSupported; > >- NSString *outputCodecs = codecs; >+ String outputCodecs = codecs; > if ([PAL::getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)]) > outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs]; > > if (!contentTypeMeetsHardwareDecodeRequirements(parameters.type, parameters.contentTypesRequiringHardwareSupport)) > return MediaPlayer::IsNotSupported; > >- NSString *typeString = [NSString stringWithFormat:@"%@; codecs=\"%@\"", (NSString *)parameters.type.containerType(), (NSString *)outputCodecs]; >- return [PAL::getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;; >+ String type = makeString(parameters.type.containerType(), "; codecs=\"", outputCodecs, "\""); >+ if (AVStreamDataParserMIMETypeCache::singleton().isAvailable()) >+ return AVStreamDataParserMIMETypeCache::singleton().canDecodeType(type) ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported; >+ return AVAssetMIMETypeCache::singleton().canDecodeType(type) ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported; > } > > #pragma mark - >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d9934a1391e..863a6afdc3c 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2019-05-03 Jer Noble <jer.noble@apple.com> >+ >+ Adopt AVStreamDataParser.audiovisualMIMETypes >+ https://bugs.webkit.org/show_bug.cgi?id=197581 >+ <rdar://problem/50458981> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebProcess/cocoa/WebProcessCocoa.mm: >+ (WebKit::WebProcess::platformInitializeWebProcess): >+ (WebKit::WebProcess::platformTerminate): >+ (WebKit::WebProcess::setMediaMIMETypes): >+ > 2019-05-01 Dean Jackson <dino@apple.com> > > Link Previews that use WKImagePreviewViewController are not always scaled correctly >diff --git a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >index 73df75c86dd..f91c51c18f7 100644 >--- a/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >+++ b/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm >@@ -49,7 +49,7 @@ > #import "WebsiteDataStoreParameters.h" > #import <JavaScriptCore/ConfigFile.h> > #import <JavaScriptCore/Options.h> >-#import <WebCore/AVFoundationMIMETypeCache.h> >+#import <WebCore/AVAssetMIMETypeCache.h> > #import <WebCore/AXObjectCache.h> > #import <WebCore/CPUMonitor.h> > #import <WebCore/DisplayRefreshMonitorManager.h> >@@ -206,7 +206,7 @@ void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters& para > if (!parameters.mediaMIMETypes.isEmpty()) > setMediaMIMETypes(parameters.mediaMIMETypes); > else { >- AVFoundationMIMETypeCache::singleton().setCacheMIMETypesCallback([this](const Vector<String>& types) { >+ AVAssetMIMETypeCache::singleton().setCacheMIMETypesCallback([this](const Vector<String>& types) { > parentProcessConnection()->send(Messages::WebProcessProxy::CacheMediaMIMETypes(types), 0); > }); > } >@@ -469,7 +469,7 @@ void WebProcess::stopRunLoop() > > void WebProcess::platformTerminate() > { >- AVFoundationMIMETypeCache::singleton().setCacheMIMETypesCallback(nullptr); >+ AVAssetMIMETypeCache::singleton().setCacheMIMETypesCallback(nullptr); > } > > RetainPtr<CFDataRef> WebProcess::sourceApplicationAuditData() const >@@ -799,7 +799,7 @@ void WebProcess::backlightLevelDidChange(float backlightLevel) > > void WebProcess::setMediaMIMETypes(const Vector<String> types) > { >- AVFoundationMIMETypeCache::singleton().setSupportedTypes(types); >+ AVAssetMIMETypeCache::singleton().setSupportedTypes(types); > } > > } // namespace WebKit
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197581
:
369005
|
369142
|
369157