Bug 207622 - MediaSource.isTypeSupported() says "video/mp4;codecs=\"avc3.42C015\"" is not supported, but it is
Summary: MediaSource.isTypeSupported() says "video/mp4;codecs=\"avc3.42C015\"" is not ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari Technology Preview
Hardware: Mac macOS 10.15
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-12 03:42 PST by Robert Bryer
Modified: 2020-02-18 14:52 PST (History)
14 users (show)

See Also:


Attachments
Patch (2.34 KB, patch)
2020-02-16 11:39 PST, Peng Liu
no flags Details | Formatted Diff | Diff
Patch (4.28 KB, patch)
2020-02-17 14:40 PST, Peng Liu
no flags Details | Formatted Diff | Diff
Fix layout test failures on the Mac debug build (4.12 KB, patch)
2020-02-18 11:15 PST, Peng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Bryer 2020-02-12 03:42:05 PST
The current Safari Technology Preview (Release 100 (Safari 13.2, WebKit 14610.1.2.1)) rejects the AVC3 codec string "video/mp4;codecs=\"avc3.42C015\"" with MediaSource.isTypeSupported(). In my current production version of Safari (13.0.3) it's accepted. It looks like this only affects AVC3 because changing it to AVC1 returns true, like "video/mp4;codecs=\"avc1.42C015\"".

And it does still play AVC3; if I ignore the codec error, it plays these videos fine without issue.
Comment 1 Radar WebKit Bug Importer 2020-02-13 10:16:24 PST
<rdar://problem/59427591>
Comment 2 Alexey Proskuryakov 2020-02-13 10:56:30 PST
I can reproduce this on macOS Mojave with STP 99. I cannot reproduce with shipping Safari/WebKit, so this looks like a regression. I cannot reproduce on macOS Catalina.

MediaSource.isTypeSupported("video/mp4;codecs=\"avc3.42C015\"")
Comment 3 Peng Liu 2020-02-16 11:39:46 PST
Created attachment 390889 [details]
Patch
Comment 4 Darin Adler 2020-02-16 12:29:16 PST
Comment on attachment 390889 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=390889&action=review

> Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:35
>  #import "ContentType.h"
> +#import <pal/spi/mac/AVFoundationSPI.h>
> +
>  #import <pal/cf/CoreMediaSoftLink.h>
>  #import <pal/cocoa/AVFoundationSoftLink.h>

These should be sorted in a single block.

> Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:71
> +    outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];

This needs to be indented.
Comment 5 Eric Carlson 2020-02-17 06:02:37 PST
Comment on attachment 390889 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=390889&action=review

>> Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:71
>> +    if ([PAL::getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)])
>> +    outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];
> 
> This needs to be indented.

We don't want to change the behavior of video.canPlayType, so I would put this into MediaPlayerPrivateMediaSourceAVFObjC::supportsType.
Comment 6 Peng Liu 2020-02-17 12:06:28 PST
Comment on attachment 390889 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=390889&action=review

>> Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:35
>>  #import <pal/cocoa/AVFoundationSoftLink.h>
> 
> These should be sorted in a single block.

Soft-link headers need to be included after other headers. The style checking errors will go away after we land the patch for http://webkit.org/b/207834.

>>> Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:71
>>> +    outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];
>> 
>> This needs to be indented.
> 
> We don't want to change the behavior of video.canPlayType, so I would put this into MediaPlayerPrivateMediaSourceAVFObjC::supportsType.

I see. Do we need to remove the similar code section in AVStreamDataParserMIMETypeCache::canDecodeExtendedType() after we add it into MediaPlayerPrivateMediaSourceAVFObjC::supportsType()? I suppose yes.
Comment 7 Peng Liu 2020-02-17 14:40:56 PST
Created attachment 390982 [details]
Patch
Comment 8 WebKit Commit Bot 2020-02-17 18:31:45 PST
Comment on attachment 390982 [details]
Patch

Clearing flags on attachment: 390982

Committed r256804: <https://trac.webkit.org/changeset/256804>
Comment 9 WebKit Commit Bot 2020-02-17 18:31:47 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Jacob Uphoff 2020-02-18 07:52:34 PST
Looks like the changes in https://trac.webkit.org/changeset/256804/webkit caused 50+ crashes on macOS debug.

Results: https://build.webkit.org/results/Apple-Catalina-Debug-WK2-Tests/r256824%20(2379)/results.html  


Build: https://build.webkit.org/builders/Apple-Catalina-Debug-WK1-Tests/builds/2532

ASSERTION FAILED: !outputCodecs.isEmpty()

This is found in the changes that were made in the revision.
Comment 11 Jacob Uphoff 2020-02-18 07:55:44 PST
Reverted r256804 for reason:

This broke 50+ media tests on mac debug

Committed r256828: <https://trac.webkit.org/changeset/256828>
Comment 12 Peng Liu 2020-02-18 11:15:34 PST
Created attachment 391071 [details]
Fix layout test failures on the Mac debug build
Comment 13 WebKit Commit Bot 2020-02-18 14:52:07 PST
The commit-queue encountered the following flaky tests while processing attachment 391071 [details]:

editing/spelling/spellcheck-async-remove-frame.html bug 158401 (authors: morrita@google.com, rniwa@webkit.org, and tony@chromium.org)
The commit-queue is continuing to process your patch.
Comment 14 WebKit Commit Bot 2020-02-18 14:52:43 PST
Comment on attachment 391071 [details]
Fix layout test failures on the Mac debug build

Clearing flags on attachment: 391071

Committed r256856: <https://trac.webkit.org/changeset/256856>
Comment 15 WebKit Commit Bot 2020-02-18 14:52:45 PST
All reviewed patches have been landed.  Closing bug.