Bug 214851 - Added constructor methods to ChannelMergerNode, ChannelSplitterNode
Summary: Added constructor methods to ChannelMergerNode, ChannelSplitterNode
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Clark Wang
URL:
Keywords: InRadar
Depends on: 214919 214931
Blocks: 212611
  Show dependency treegraph
 
Reported: 2020-07-27 15:20 PDT by Clark Wang
Modified: 2020-07-29 16:29 PDT (History)
17 users (show)

See Also:


Attachments
Patch (81.14 KB, patch)
2020-07-27 15:26 PDT, Clark Wang
no flags Details | Formatted Diff | Diff
Patch (85.11 KB, patch)
2020-07-28 06:20 PDT, Clark Wang
no flags Details | Formatted Diff | Diff
Patch (84.74 KB, patch)
2020-07-28 11:09 PDT, Clark Wang
no flags Details | Formatted Diff | Diff
Patch (88.76 KB, patch)
2020-07-29 12:27 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (85.35 KB, patch)
2020-07-29 14:23 PDT, Clark Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.