Index: third_party/WebKit/Source/platform/audio/AudioBus.h |
diff --git a/third_party/WebKit/Source/platform/audio/AudioBus.h b/third_party/WebKit/Source/platform/audio/AudioBus.h |
index 0db59bd84b8525b86c68eaeaa32fd324f7e93af2..d0f834833299d30ccb96b986c495f3203939d5b7 100644 |
--- a/third_party/WebKit/Source/platform/audio/AudioBus.h |
+++ b/third_party/WebKit/Source/platform/audio/AudioBus.h |
@@ -38,8 +38,8 @@ |
namespace blink { |
// An AudioBus represents a collection of one or more AudioChannels. |
-// The data layout is "planar" as opposed to "interleaved". |
-// An AudioBus with one channel is mono, an AudioBus with two channels is stereo, etc. |
+// The data layout is "planar" as opposed to "interleaved". An AudioBus with |
+// one channel is mono, an AudioBus with two channels is stereo, etc. |
class PLATFORM_EXPORT AudioBus : public ThreadSafeRefCounted<AudioBus> { |
WTF_MAKE_NONCOPYABLE(AudioBus); |
@@ -64,9 +64,11 @@ class PLATFORM_EXPORT AudioBus : public ThreadSafeRefCounted<AudioBus> { |
Discrete, |
}; |
- // allocate indicates whether or not to initially have the AudioChannels created with managed storage. |
- // Normal usage is to pass true here, in which case the AudioChannels will memory-manage their own storage. |
- // If allocate is false then setChannelMemory() has to be called later on for each channel before the AudioBus is useable... |
+ // allocate indicates whether or not to initially have the AudioChannels |
+ // created with managed storage. Normal usage is to pass true here, in which |
+ // case the AudioChannels will memory-manage their own storage. If allocate |
+ // is false then setChannelMemory() has to be called later on for each |
+ // channel before the AudioBus is useable... |
static PassRefPtr<AudioBus> create(unsigned numberOfChannels, |
size_t length, |
bool allocate = true); |
@@ -114,16 +116,19 @@ class PLATFORM_EXPORT AudioBus : public ThreadSafeRefCounted<AudioBus> { |
unsigned startFrame, |
unsigned endFrame); |
- // Creates a new AudioBus by sample-rate converting sourceBus to the newSampleRate. |
+ // Creates a new AudioBus by sample-rate converting sourceBus to the |
+ // newSampleRate. |
// setSampleRate() must have been previously called on sourceBus. |
- // Note: sample-rate conversion is already handled in the file-reading code for the mac port, so we don't need this. |
+ // Note: sample-rate conversion is already handled in the file-reading code |
+ // for the mac port, so we don't need this. |
static PassRefPtr<AudioBus> createBySampleRateConverting( |
const AudioBus* sourceBus, |
bool mixToMono, |
double newSampleRate); |
// Creates a new AudioBus by mixing all the channels down to mono. |
- // If sourceBus is already mono, then the returned AudioBus will simply be a copy. |
+ // If sourceBus is already mono, then the returned AudioBus will simply be a |
+ // copy. |
static PassRefPtr<AudioBus> createByMixingToMono(const AudioBus* sourceBus); |
// Scales all samples by the same amount. |
@@ -132,16 +137,21 @@ class PLATFORM_EXPORT AudioBus : public ThreadSafeRefCounted<AudioBus> { |
void reset() { m_isFirstTime = true; } // for de-zippering |
// Copies the samples from the source bus to this one. |
- // This is just a simple per-channel copy if the number of channels match, otherwise an up-mix or down-mix is done. |
+ // This is just a simple per-channel copy if the number of channels match, |
+ // otherwise an up-mix or down-mix is done. |
void copyFrom(const AudioBus& sourceBus, ChannelInterpretation = Speakers); |
// Sums the samples from the source bus to this one. |
- // This is just a simple per-channel summing if the number of channels match, otherwise an up-mix or down-mix is done. |
+ // This is just a simple per-channel summing if the number of channels match, |
+ // otherwise an up-mix or down-mix is done. |
void sumFrom(const AudioBus& sourceBus, ChannelInterpretation = Speakers); |
// Copy each channel from sourceBus into our corresponding channel. |
- // We scale by targetGain (and our own internal gain m_busGain), performing "de-zippering" to smoothly change from *lastMixGain to (targetGain*m_busGain). |
- // The caller is responsible for setting up lastMixGain to point to storage which is unique for every "stream" which will be applied to this bus. |
+ // We scale by targetGain (and our own internal gain m_busGain), performing |
+ // "de-zippering" to smoothly change from *lastMixGain to |
+ // (targetGain*m_busGain). The caller is responsible for setting up |
+ // lastMixGain to point to storage which is unique for every "stream" which |
+ // will be applied to this bus. |
// This represents the dezippering memory. |
void copyWithGainFrom(const AudioBus& sourceBus, |
float* lastMixGain, |
@@ -152,7 +162,8 @@ class PLATFORM_EXPORT AudioBus : public ThreadSafeRefCounted<AudioBus> { |
float* gainValues, |
unsigned numberOfGainValues); |
- // Returns maximum absolute value across all channels (useful for normalization). |
+ // Returns maximum absolute value across all channels (useful for |
+ // normalization). |
float maxAbsValue() const; |
// Makes maximum absolute value == 1.0 (if possible). |