Bug 214851

Summary: Added constructor methods to ChannelMergerNode, ChannelSplitterNode
Product: WebKit Reporter: Clark Wang <clark_wang>
Component: Web AudioAssignee: Clark Wang <clark_wang>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, annulen, ap, cdumez, commit-queue, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, jer.noble, kondapallykalyan, philipj, ryuan.choi, sergio, webkit-bot-watchers-bugzilla, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 214919, 214931    
Bug Blocks: 212611    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch
none
Patch none

Description Clark Wang 2020-07-27 15:20:22 PDT
Added constructors according to spec: https://www.w3.org/TR/webaudio/#ChannelMergerNode-constructors. Added new files for ChannelMergerOptions and ChannelSplitterOptions.
Comment 1 Clark Wang 2020-07-27 15:26:41 PDT
Created attachment 405315 [details]
Patch
Comment 2 Clark Wang 2020-07-28 06:20:10 PDT
Created attachment 405354 [details]
Patch
Comment 3 Chris Dumez 2020-07-28 10:14:05 PDT
Comment on attachment 405354 [details]
Patch

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

> Source/WebCore/Modules/webaudio/ChannelMergerNode.cpp:48
> +    if (options.numberOfInputs > AudioContext::maxNumberOfChannels() || options.numberOfInputs <= 0)

|| !options.numberOfInputs

numberOfInputs is unsigned so it cannot be negative.

> Source/WebCore/Modules/webaudio/ChannelSplitterNode.cpp:42
> +    if (options.numberOfOutputs > AudioContext::maxNumberOfChannels() || options.numberOfOutputs <= 0)

|| !options.numberOfOutputs

> Source/WebCore/Modules/webaudio/ChannelSplitterNode.cpp:64
> +    , m_numberOfOutputs(numberOfOutputs)

Why do we need this data member? Looks like you could use existing numberOfOutputs() ?
Comment 4 Clark Wang 2020-07-28 11:08:52 PDT
(In reply to Chris Dumez from comment #3)
> Comment on attachment 405354 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=405354&action=review
> 
> > Source/WebCore/Modules/webaudio/ChannelMergerNode.cpp:48
> > +    if (options.numberOfInputs > AudioContext::maxNumberOfChannels() || options.numberOfInputs <= 0)
> 
> || !options.numberOfInputs
> 
> numberOfInputs is unsigned so it cannot be negative.
> 
> > Source/WebCore/Modules/webaudio/ChannelSplitterNode.cpp:42
> > +    if (options.numberOfOutputs > AudioContext::maxNumberOfChannels() || options.numberOfOutputs <= 0)
> 
> || !options.numberOfOutputs
> 
> > Source/WebCore/Modules/webaudio/ChannelSplitterNode.cpp:64
> > +    , m_numberOfOutputs(numberOfOutputs)
> 
> Why do we need this data member? Looks like you could use existing
> numberOfOutputs() ?

Ah, I didn't know of this method. Thanks!
Comment 5 Clark Wang 2020-07-28 11:09:05 PDT
Created attachment 405379 [details]
Patch
Comment 6 EWS 2020-07-28 13:14:36 PDT
Committed r265002: <https://trac.webkit.org/changeset/265002>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 405379 [details].
Comment 7 Radar WebKit Bug Importer 2020-07-28 13:15:30 PDT
<rdar://problem/66233763>
Comment 8 Aakash Jain 2020-07-29 05:29:14 PDT
(In reply to EWS from comment #6)
> Committed r265002: <https://trac.webkit.org/changeset/265002>
This broke imported/w3c/web-platform-tests/webaudio/the-audio-api/the-scriptprocessornode-interface/simple-input-output.html for mac-debug-wk1. EWS also indicated this on previous version on this patch.

History: https://results.webkit.org/?suite=layout-tests&test=imported%2Fw3c%2Fweb-platform-tests%2Fwebaudio%2Fthe-audio-api%2Fthe-scriptprocessornode-interface%2Fsimple-input-output.html
Comment 9 WebKit Commit Bot 2020-07-29 05:34:00 PDT
Re-opened since this is blocked by bug 214919
Comment 10 Chris Dumez 2020-07-29 12:27:04 PDT
Created attachment 405483 [details]
Patch
Comment 11 Chris Dumez 2020-07-29 12:41:32 PDT
Comment on attachment 405379 [details]
Patch

Splitting fix for crash to Bug 214931. The constructors added in this patch will have to be updated accordingly too.
Comment 12 Clark Wang 2020-07-29 14:23:15 PDT
Created attachment 405500 [details]
Patch
Comment 13 Chris Dumez 2020-07-29 15:50:19 PDT
Comment on attachment 405500 [details]
Patch

r=me
Comment 14 Chris Dumez 2020-07-29 16:29:53 PDT
Comment on attachment 405500 [details]
Patch

Clearing flags on attachment: 405500

Committed r265066: <https://trac.webkit.org/changeset/265066>
Comment 15 Chris Dumez 2020-07-29 16:29:56 PDT
All reviewed patches have been landed.  Closing bug.