Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Issue 2582443004: ScriptProcessor buffer size should be consistent with callback size (Closed)

Created:
4 years ago by Raymond Toy
Modified:
4 years ago
Reviewers:
hongchan
CC:
chromium-reviews, blink-reviews, haraken, Raymond Toy, hongchan
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ScriptProcessor buffer size should be consistent with callback size When selecting a buffer size for a ScriptProcessorNode (when constructed using a requested size of 0), the selected size needs to be consistent with the actuall callback buffer size of the AudioContext. Previously, the value was based on the audio hardware size, which could be very small (128 or 256) on some Android devices, but the actual callback size is much larger (1024 or 2048). This causes glitching because we will fire the process event back-to-back because of the multiple calls ot process() to satisfy the callback buffer size. Thus, add appropriate interfaces so that an AudioContext (and BaseAudioContext) can get the callback buffer size from the AudioDestination. Also, for an offline context, we can just always return a value of 256 (the smallest) for the buffer size. There is no constraint here because the offline context waits for the ScriptProcessor to finish before continuing. BUG=673854 TEST= Committed: https://crrev.com/94c37e9181e0619415e8f4d2be3f631b44fe2e64 Cr-Commit-Position: refs/heads/master@{#439927}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Make callbackBufferSize pure virtual #

Messages

Total messages: 18 (10 generated)
Raymond Toy
PTAL. This is a first step at optimizing this. At the least, we need to ...
4 years ago (2016-12-19 18:52:58 UTC) #5
Raymond Toy
PTAL.
4 years ago (2016-12-20 16:32:37 UTC) #7
hongchan
Refactor the change if possible, but I will leave it up to you. lgtm https://codereview.chromium.org/2582443004/diff/1/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h ...
4 years ago (2016-12-20 20:35:13 UTC) #8
hongchan
You can refactor/simplify changes if possible, but I'll leave it up to you. lgtm
4 years ago (2016-12-20 20:35:39 UTC) #9
Raymond Toy
https://codereview.chromium.org/2582443004/diff/1/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h File third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h (right): https://codereview.chromium.org/2582443004/diff/1/third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h#newcode68 third_party/WebKit/Source/modules/webaudio/AudioDestinationNode.h:68: virtual size_t callbackBufferSize() const { return 0; } On ...
4 years ago (2016-12-20 21:55:32 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2582443004/20001
4 years ago (2016-12-20 21:57:11 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years ago (2016-12-20 23:38:15 UTC) #16
commit-bot: I haz the power
4 years ago (2016-12-20 23:40:14 UTC) #18
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/94c37e9181e0619415e8f4d2be3f631b44fe2e64
Cr-Commit-Position: refs/heads/master@{#439927}

Powered by Google App Engine
This is Rietveld 408576698