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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/AudioNodeOutput.cpp

Issue 2440583002: Use AudioUtilities::kRenderQuantumFrames everywhere (Closed)
Patch Set: Address review comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 27 matching lines...) Expand all
38 m_numberOfChannels(numberOfChannels), 38 m_numberOfChannels(numberOfChannels),
39 m_desiredNumberOfChannels(numberOfChannels), 39 m_desiredNumberOfChannels(numberOfChannels),
40 m_isInPlace(false), 40 m_isInPlace(false),
41 m_isEnabled(true), 41 m_isEnabled(true),
42 m_didCallDispose(false), 42 m_didCallDispose(false),
43 m_renderingFanOutCount(0), 43 m_renderingFanOutCount(0),
44 m_renderingParamFanOutCount(0) { 44 m_renderingParamFanOutCount(0) {
45 DCHECK_LE(numberOfChannels, BaseAudioContext::maxNumberOfChannels()); 45 DCHECK_LE(numberOfChannels, BaseAudioContext::maxNumberOfChannels());
46 46
47 m_internalBus = 47 m_internalBus =
48 AudioBus::create(numberOfChannels, AudioHandler::ProcessingSizeInFrames); 48 AudioBus::create(numberOfChannels, AudioUtilities::kRenderQuantumFrames);
49 } 49 }
50 50
51 std::unique_ptr<AudioNodeOutput> AudioNodeOutput::create( 51 std::unique_ptr<AudioNodeOutput> AudioNodeOutput::create(
52 AudioHandler* handler, 52 AudioHandler* handler,
53 unsigned numberOfChannels) { 53 unsigned numberOfChannels) {
54 return wrapUnique(new AudioNodeOutput(handler, numberOfChannels)); 54 return wrapUnique(new AudioNodeOutput(handler, numberOfChannels));
55 } 55 }
56 56
57 void AudioNodeOutput::dispose() { 57 void AudioNodeOutput::dispose() {
58 m_didCallDispose = true; 58 m_didCallDispose = true;
(...skipping 20 matching lines...) Expand all
79 // render tasks. 79 // render tasks.
80 deferredTaskHandler().markAudioNodeOutputDirty(this); 80 deferredTaskHandler().markAudioNodeOutputDirty(this);
81 } 81 }
82 } 82 }
83 83
84 void AudioNodeOutput::updateInternalBus() { 84 void AudioNodeOutput::updateInternalBus() {
85 if (numberOfChannels() == m_internalBus->numberOfChannels()) 85 if (numberOfChannels() == m_internalBus->numberOfChannels())
86 return; 86 return;
87 87
88 m_internalBus = AudioBus::create(numberOfChannels(), 88 m_internalBus = AudioBus::create(numberOfChannels(),
89 AudioHandler::ProcessingSizeInFrames); 89 AudioUtilities::kRenderQuantumFrames);
90 } 90 }
91 91
92 void AudioNodeOutput::updateRenderingState() { 92 void AudioNodeOutput::updateRenderingState() {
93 updateNumberOfChannels(); 93 updateNumberOfChannels();
94 m_renderingFanOutCount = fanOutCount(); 94 m_renderingFanOutCount = fanOutCount();
95 m_renderingParamFanOutCount = paramFanOutCount(); 95 m_renderingParamFanOutCount = paramFanOutCount();
96 } 96 }
97 97
98 void AudioNodeOutput::updateNumberOfChannels() { 98 void AudioNodeOutput::updateNumberOfChannels() {
99 DCHECK(deferredTaskHandler().isAudioThread()); 99 DCHECK(deferredTaskHandler().isAudioThread());
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 ASSERT(deferredTaskHandler().isGraphOwner()); 238 ASSERT(deferredTaskHandler().isGraphOwner());
239 239
240 if (!m_isEnabled) { 240 if (!m_isEnabled) {
241 m_isEnabled = true; 241 m_isEnabled = true;
242 for (AudioNodeInput* i : m_inputs) 242 for (AudioNodeInput* i : m_inputs)
243 i->enable(*this); 243 i->enable(*this);
244 } 244 }
245 } 245 }
246 246
247 } // namespace blink 247 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698