Bug 221745 - [Mac] Add Experimental Opus Codec support
Summary: [Mac] Add Experimental Opus Codec support
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-02-11 00:02 PST by Jer Noble
Modified: 2021-02-11 16:09 PST (History)
11 users (show)

See Also:


Attachments
Patch (24.05 KB, patch)
2021-02-11 00:11 PST, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (23.95 KB, patch)
2021-02-11 00:20 PST, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (30.70 KB, patch)
2021-02-11 00:36 PST, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (30.73 KB, patch)
2021-02-11 08:32 PST, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (30.72 KB, patch)
2021-02-11 09:22 PST, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2021-02-11 00:02:33 PST
[Mac] Add Experimental Opus Codec support
Comment 1 Jer Noble 2021-02-11 00:11:48 PST
Created attachment 419953 [details]
Patch
Comment 2 Jer Noble 2021-02-11 00:20:12 PST
Created attachment 419955 [details]
Patch
Comment 3 Jer Noble 2021-02-11 00:36:51 PST
Created attachment 419956 [details]
Patch
Comment 4 Jer Noble 2021-02-11 08:32:33 PST
Created attachment 419992 [details]
Patch
Comment 5 Chris Dumez 2021-02-11 09:01:14 PST
Is this a dupe of https://bugs.webkit.org/show_bug.cgi?id=183852 ?
Comment 6 Eric Carlson 2021-02-11 09:08:15 PST
(In reply to Chris Dumez from comment #5)
> Is this a dupe of https://bugs.webkit.org/show_bug.cgi?id=183852 ?

No, this patch won't make Opus available to WebAudio.
Comment 7 Jer Noble 2021-02-11 09:22:12 PST
Created attachment 419999 [details]
Patch
Comment 8 Eric Carlson 2021-02-11 09:23:57 PST
Comment on attachment 419999 [details]
Patch

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

r=me once the bots are happy

> Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:329
>      static dispatch_once_t onceToken;
>      dispatch_once(&onceToken, ^{
>          available = registerDecoderFactory("ACOpusDecoderFactory", 'opus');

It turns out we don't need to explicitly register the Opus codec component, so this can be removed.
Comment 9 Ashley Gullen 2021-02-11 09:31:19 PST
We've been desperate for WebM Opus support in Safari for years - all major browsers support it except Safari, making it an awkward compatibility problem to deal with when trying to get audio playback to work across browsers. It would be fantastic if support for this was added!

We also need support in Web Audio's decodeAudioData - is there a separate issue to track that? Is this just for the <audio> element so far?

Safari should support both at the same time, since the de-facto way to feature detect the types decodeAudioData can decode is via new Audio().canPlayType(). If that indicates support for WebM Opus when decodeAudioData does not support it, existing web content will be broken as it would incorrectly activate attempting to decode WebM Opus with decodeAudioData. Supporting both at the same time will avoid this problem.
Comment 10 Jer Noble 2021-02-11 12:06:22 PST
(In reply to Eric Carlson from comment #8)
> Comment on attachment 419999 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=419999&action=review
> 
> r=me once the bots are happy
> 
> > Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:329
> >      static dispatch_once_t onceToken;
> >      dispatch_once(&onceToken, ^{
> >          available = registerDecoderFactory("ACOpusDecoderFactory", 'opus');
> 
> It turns out we don't need to explicitly register the Opus codec component,
> so this can be removed.

I'll remove this in a follow up patch.
Comment 11 EWS 2021-02-11 12:37:31 PST
commit-queue failed to commit attachment 419999 [details] to WebKit repository. To retry, please set cq+ flag again.
Comment 12 EWS 2021-02-11 16:08:42 PST
Committed r272758: <https://commits.webkit.org/r272758>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 419999 [details].
Comment 13 Radar WebKit Bug Importer 2021-02-11 16:09:13 PST
<rdar://problem/74255423>