Summary: | Added copyFromChannel, copyToChannel to AudioBuffer | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Clark Wang <clark_wang> | ||||||||
Component: | Web Audio | Assignee: | Clark Wang <clark_wang> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | cdumez, darin, eric.carlson, esprehn+autocc, ews-watchlist, glenn, jer.noble, kondapallykalyan, philipj, sergio, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 212611 | ||||||||||
Attachments: |
|
Description
Clark Wang
2020-07-29 11:43:23 PDT
Created attachment 405477 [details]
Patch
Comment on attachment 405477 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405477&action=review > Source/WebCore/Modules/webaudio/AudioBuffer.h:57 > + ExceptionOr<void> copyFromChannel(Ref<Float32Array>, size_t channelNumber, size_t bufferOffset); > + ExceptionOr<void> copyToChannel(Ref<Float32Array>, size_t channelNumber, size_t startInChannel); Ref<Float32Array> is not the correct argument type; creates unnecessary reference count churn. Ref<Float32Array>&& is better. Comment on attachment 405477 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=405477&action=review > Source/WebCore/Modules/webaudio/AudioBuffer.cpp:128 > +ExceptionOr<void> AudioBuffer::copyFromChannel(Ref<Float32Array> destination, size_t channelNumber, size_t bufferOffset) Ref<Float32Array>&&. It may be a good idea to use unsigned type for the other parameters, to match the IDL > Source/WebCore/Modules/webaudio/AudioBuffer.cpp:130 > + if (destination.get().isShared()) destination->isShared() > Source/WebCore/Modules/webaudio/AudioBuffer.cpp:134 > + return Exception { IndexSizeError, "channelNumber is out of index."_s }; "out of index" ? > Source/WebCore/Modules/webaudio/AudioBuffer.cpp:147 > + float* dst = destination.get().data(); destination->data() > Source/WebCore/Modules/webaudio/AudioBuffer.cpp:156 > +ExceptionOr<void> AudioBuffer::copyToChannel(Ref<Float32Array> source, size_t channelNumber, size_t bufferOffset) Ref<Float32Array>&& and unsigned for others. > Source/WebCore/Modules/webaudio/AudioBuffer.cpp:162 > + return Exception { IndexSizeError, "channelNumber is out of index."_s }; "out of index"? Created attachment 405491 [details]
Patch
Created attachment 405498 [details]
Patch
New patch includes a re-baselined test that incorporates new ExceptionError message. Committed r265062: <https://trac.webkit.org/changeset/265062> All reviewed patches have been landed. Closing bug and clearing flags on attachment 405498 [details]. |