Bug 219810

Summary: [Cocoa] Add Experimental Vorbis support
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, ews-watchlist, glenn, jer.noble, philipj, sam, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Eric Carlson 2020-12-11 16:07:49 PST
Add experimental Vorbis support
Comment 1 Radar WebKit Bug Importer 2020-12-11 16:08:12 PST
<rdar://problem/72242614>
Comment 2 Eric Carlson 2020-12-11 16:16:29 PST
Created attachment 416063 [details]
Patch
Comment 3 Jer Noble 2020-12-11 16:19:52 PST
Comment on attachment 416063 [details]
Patch

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

> Source/WebCore/page/RuntimeEnabledFeatures.h:399
> +    bool m_VorbisDecoderEnabled { false };

Nit: the capitalization here is weird.
Comment 4 Eric Carlson 2020-12-11 16:23:06 PST
Created attachment 416066 [details]
Patch
Comment 5 Jer Noble 2020-12-11 17:18:45 PST
Comment on attachment 416066 [details]
Patch

Clearing flags on attachment: 416066

Committed r270722: <https://trac.webkit.org/changeset/270722>
Comment 6 Jer Noble 2020-12-11 17:18:47 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Sam Weinig 2020-12-19 11:11:34 PST
Comment on attachment 416066 [details]
Patch

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

> Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:181
> +    if (!RuntimeEnabledFeatures::sharedFeatures().vorbisDecoderEnabled())
> +        return false;

Hey Eric, this is a layering violation in WebCore. By rule, you cannot use the RuntimeEnabledFeatures in the platform/ part of WebCore (platform is the platform abstraction layer and therefore should not be directly influence by WebCore level concepts like this). 

The pattern I suggest for things like this having the platform level classes provide some configuration options (much like any API would) and having the parts of WebCore outside the platform directory that need to use platform concepts pass in setting state using those configuration options.
Comment 8 Eric Carlson 2020-12-20 22:18:02 PST
Comment on attachment 416066 [details]
Patch

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

>> Source/WebCore/platform/graphics/cocoa/WebMAudioUtilitiesCocoa.mm:181
>> +        return false;
> 
> Hey Eric, this is a layering violation in WebCore. By rule, you cannot use the RuntimeEnabledFeatures in the platform/ part of WebCore (platform is the platform abstraction layer and therefore should not be directly influence by WebCore level concepts like this). 
> 
> The pattern I suggest for things like this having the platform level classes provide some configuration options (much like any API would) and having the parts of WebCore outside the platform directory that need to use platform concepts pass in setting state using those configuration options.

Oops! 

https://bugs.webkit.org/show_bug.cgi?id=220052 cleans this up a bit.