Chromium Code Reviews| Index: media/base/audio_block_fifo.h |
| diff --git a/media/base/audio_block_fifo.h b/media/base/audio_block_fifo.h |
| index a90a3dfe65661a3b089f517703c53d9de6c18f78..30f18c20c1d5e3b47efa9fbe9dee3b7149b676b4 100644 |
| --- a/media/base/audio_block_fifo.h |
| +++ b/media/base/audio_block_fifo.h |
| @@ -29,6 +29,9 @@ class MEDIA_EXPORT AudioBlockFifo { |
| // Push() will crash if the allocated space is insufficient. |
| void Push(const void* source, int frames, int bytes_per_sample); |
| + // Pushes zeroed out interleaved audio data to the FIFO. |
|
tommi (sloooow) - chröme
2017/02/17 18:07:23
oops, will s/interleaved audio data/frames
|
| + void PushSilence(int frames); |
| + |
| // Consumes a block of audio from the FIFO. Returns an AudioBus which |
| // contains the consumed audio data to avoid copying. |
| // Consume() will crash if the FIFO does not contain a block of data. |
| @@ -50,6 +53,11 @@ class MEDIA_EXPORT AudioBlockFifo { |
| void IncreaseCapacity(int blocks); |
| private: |
| + // Common implementation for Push() and PushSilence. if |source| is nullptr, |
| + // silence will be pushed. To push silence, set source and bytes_per_sample to |
| + // nullptr and 0 respectively. |
| + void PushInternal(const void* source, int frames, int bytes_per_sample); |
| + |
| // The actual FIFO is a vector of audio buses. |
| ScopedVector<AudioBus> audio_blocks_; |