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

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

Issue 2440583002: Use AudioUtilities::kRenderQuantumFrames everywhere (Closed)
Patch Set: Remove unneeded include of AudioUtilities.h. Created 4 years, 2 months 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 // to mono if necessary. 257 // to mono if necessary.
258 RefPtr<AudioBus> summingBus = AudioBus::create(1, numberOfValues, false); 258 RefPtr<AudioBus> summingBus = AudioBus::create(1, numberOfValues, false);
259 summingBus->setChannelMemory(0, values, numberOfValues); 259 summingBus->setChannelMemory(0, values, numberOfValues);
260 260
261 for (unsigned i = 0; i < numberOfRenderingConnections(); ++i) { 261 for (unsigned i = 0; i < numberOfRenderingConnections(); ++i) {
262 AudioNodeOutput* output = renderingOutput(i); 262 AudioNodeOutput* output = renderingOutput(i);
263 DCHECK(output); 263 DCHECK(output);
264 264
265 // Render audio from this output. 265 // Render audio from this output.
266 AudioBus* connectionBus = 266 AudioBus* connectionBus =
267 output->pull(0, AudioHandler::ProcessingSizeInFrames); 267 output->pull(0, AudioUtilities::kRenderQuantumFrames);
268 268
269 // Sum, with unity-gain. 269 // Sum, with unity-gain.
270 summingBus->sumFrom(*connectionBus); 270 summingBus->sumFrom(*connectionBus);
271 } 271 }
272 } 272 }
273 273
274 void AudioParamHandler::calculateTimelineValues(float* values, 274 void AudioParamHandler::calculateTimelineValues(float* values,
275 unsigned numberOfValues) { 275 unsigned numberOfValues) {
276 // Calculate values for this render quantum. Normally numberOfValues will 276 // Calculate values for this render quantum. Normally numberOfValues will
277 // equal to AudioHandler::ProcessingSizeInFrames (the render quantum size). 277 // equal to AudioHandler::AudioUtilities::kRenderQuantumFrames (the render
hongchan 2016/10/24 16:23:24 Remove 'AudioHandler::'
Raymond Toy 2016/10/31 22:30:05 Done (with a few other cosmetic changes like |numb
278 // quantum size).
278 double sampleRate = destinationHandler().sampleRate(); 279 double sampleRate = destinationHandler().sampleRate();
279 size_t startFrame = destinationHandler().currentSampleFrame(); 280 size_t startFrame = destinationHandler().currentSampleFrame();
280 size_t endFrame = startFrame + numberOfValues; 281 size_t endFrame = startFrame + numberOfValues;
281 282
282 // Note we're running control rate at the sample-rate. 283 // Note we're running control rate at the sample-rate.
283 // Pass in the current value as default value. 284 // Pass in the current value as default value.
284 setIntrinsicValue(m_timeline.valuesForFrameRange( 285 setIntrinsicValue(m_timeline.valuesForFrameRange(
285 startFrame, endFrame, intrinsicValue(), values, numberOfValues, 286 startFrame, endFrame, intrinsicValue(), values, numberOfValues,
286 sampleRate, sampleRate, minValue(), maxValue())); 287 sampleRate, sampleRate, minValue(), maxValue()));
287 } 288 }
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 return this; 511 return this;
511 } 512 }
512 513
513 AudioParam* AudioParam::cancelScheduledValues(double startTime, 514 AudioParam* AudioParam::cancelScheduledValues(double startTime,
514 ExceptionState& exceptionState) { 515 ExceptionState& exceptionState) {
515 handler().timeline().cancelScheduledValues(startTime, exceptionState); 516 handler().timeline().cancelScheduledValues(startTime, exceptionState);
516 return this; 517 return this;
517 } 518 }
518 519
519 } // namespace blink 520 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698