Title: [256856] trunk/Source/WebCore
Revision
256856
Author
peng.l...@apple.com
Date
2020-02-18 14:52:38 -0800 (Tue, 18 Feb 2020)

Log Message

MediaSource.isTypeSupported() says "video/mp4;codecs=\"avc3.42C015\"" is not supported, but it is
https://bugs.webkit.org/show_bug.cgi?id=207622

Reviewed by Eric Carlson.

Revert the behavior change of MediaPlayerPrivateMediaSourceAVFObjC::supportsType() in r253952.

* platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
(WebCore::AVAssetMIMETypeCache::canDecodeExtendedType):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (256855 => 256856)


--- trunk/Source/WebCore/ChangeLog	2020-02-18 22:41:15 UTC (rev 256855)
+++ trunk/Source/WebCore/ChangeLog	2020-02-18 22:52:38 UTC (rev 256856)
@@ -1,3 +1,15 @@
+2020-02-18  Peng Liu  <peng.l...@apple.com>
+
+        MediaSource.isTypeSupported() says "video/mp4;codecs=\"avc3.42C015\"" is not supported, but it is
+        https://bugs.webkit.org/show_bug.cgi?id=207622
+
+        Reviewed by Eric Carlson.
+
+        Revert the behavior change of MediaPlayerPrivateMediaSourceAVFObjC::supportsType() in r253952.
+
+        * platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:
+        (WebCore::AVAssetMIMETypeCache::canDecodeExtendedType):
+
 2020-02-18  Antti Koivisto  <an...@apple.com>
 
         [macOS] Don't fire timers when there is a pending rendering update

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm (256855 => 256856)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm	2020-02-18 22:41:15 UTC (rev 256855)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/AVStreamDataParserMIMETypeCache.mm	2020-02-18 22:52:38 UTC (rev 256856)
@@ -59,14 +59,8 @@
 #if ENABLE(VIDEO) && USE(AVFOUNDATION)
     ASSERT(isAvailable());
 
-    String outputCodecs = type.parameter(ContentType::codecsParameter());
-    ASSERT(!outputCodecs.isEmpty());
-    if ([PAL::getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)])
-        outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];
-
-    String extendedType = makeString(type.containerType(), "; codecs=\"", outputCodecs, "\"");
     if ([PAL::getAVStreamDataParserClass() respondsToSelector:@selector(canParseExtendedMIMEType:)])
-        return [PAL::getAVStreamDataParserClass() canParseExtendedMIMEType:extendedType];
+        return [PAL::getAVStreamDataParserClass() canParseExtendedMIMEType:type.raw()];
 
     // FIXME(rdar://50502771) AVStreamDataParser does not have an -canParseExtendedMIMEType: method on this system,
     //  so just replace the container type with a valid one from AVAssetMIMETypeCache and ask that cache if it

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm (256855 => 256856)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2020-02-18 22:41:15 UTC (rev 256855)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm	2020-02-18 22:52:38 UTC (rev 256856)
@@ -253,14 +253,21 @@
     if (!parameters.isMediaSource)
         return MediaPlayer::SupportsType::IsNotSupported;
 
+    String extendedType = parameters.type.raw();
+    String outputCodecs = parameters.type.parameter(ContentType::codecsParameter());
+    if (!outputCodecs.isEmpty() && [PAL::getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)]) {
+        outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];
+        extendedType = makeString(parameters.type.containerType(), "; codecs=\"", outputCodecs, "\"");
+    }
+
     auto supported = MediaPlayer::SupportsType::IsNotSupported;
     auto& streamDataParserCache = AVStreamDataParserMIMETypeCache::singleton();
     if (streamDataParserCache.isAvailable())
-        supported = streamDataParserCache.canDecodeType(parameters.type.raw());
+        supported = streamDataParserCache.canDecodeType(extendedType);
     else {
         auto& assetCache = AVAssetMIMETypeCache::singleton();
         if (assetCache.isAvailable())
-            supported = assetCache.canDecodeType(parameters.type.raw());
+            supported = assetCache.canDecodeType(extendedType);
     }
 
     if (supported != MediaPlayer::SupportsType::IsSupported)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to