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

Side by Side Diff: third_party/WebKit/Source/modules/webaudio/ScriptProcessorNode.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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 size_t bufferSize, 43 size_t bufferSize,
44 unsigned numberOfInputChannels, 44 unsigned numberOfInputChannels,
45 unsigned numberOfOutputChannels) 45 unsigned numberOfOutputChannels)
46 : AudioHandler(NodeTypeJavaScript, node, sampleRate), 46 : AudioHandler(NodeTypeJavaScript, node, sampleRate),
47 m_doubleBufferIndex(0), 47 m_doubleBufferIndex(0),
48 m_bufferSize(bufferSize), 48 m_bufferSize(bufferSize),
49 m_bufferReadWriteIndex(0), 49 m_bufferReadWriteIndex(0),
50 m_numberOfInputChannels(numberOfInputChannels), 50 m_numberOfInputChannels(numberOfInputChannels),
51 m_numberOfOutputChannels(numberOfOutputChannels), 51 m_numberOfOutputChannels(numberOfOutputChannels),
52 m_internalInputBus(AudioBus::create(numberOfInputChannels, 52 m_internalInputBus(AudioBus::create(numberOfInputChannels,
53 ProcessingSizeInFrames, 53 AudioUtilities::kRenderQuantumFrames,
54 false)) { 54 false)) {
55 // Regardless of the allowed buffer sizes, we still need to process at the 55 // Regardless of the allowed buffer sizes, we still need to process at the
56 // granularity of the AudioNode. 56 // granularity of the AudioNode.
57 if (m_bufferSize < ProcessingSizeInFrames) 57 if (m_bufferSize < AudioUtilities::kRenderQuantumFrames)
58 m_bufferSize = ProcessingSizeInFrames; 58 m_bufferSize = AudioUtilities::kRenderQuantumFrames;
59 59
60 DCHECK_LE(numberOfInputChannels, BaseAudioContext::maxNumberOfChannels()); 60 DCHECK_LE(numberOfInputChannels, BaseAudioContext::maxNumberOfChannels());
61 61
62 addInput(); 62 addInput();
63 addOutput(numberOfOutputChannels); 63 addOutput(numberOfOutputChannels);
64 64
65 m_channelCount = numberOfInputChannels; 65 m_channelCount = numberOfInputChannels;
66 setInternalChannelCountMode(Explicit); 66 setInternalChannelCountMode(Explicit);
67 67
68 initialize(); 68 initialize();
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 473
474 // If |onaudioprocess| event handler is defined, the node should not be 474 // If |onaudioprocess| event handler is defined, the node should not be
475 // GCed even if it is out of scope. 475 // GCed even if it is out of scope.
476 if (hasEventListeners(EventTypeNames::audioprocess)) 476 if (hasEventListeners(EventTypeNames::audioprocess))
477 return true; 477 return true;
478 478
479 return false; 479 return false;
480 } 480 }
481 481
482 } // namespace blink 482 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698