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

Unified Diff: media/base/audio_block_fifo.h

Issue 2690793002: Add basic resample support to WASAPIAudioInputStream. (Closed)
Patch Set: Add check for unsupported channel layout Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/win/audio_low_latency_input_win_unittest.cc ('k') | media/base/audio_block_fifo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8c0d5f5cccdc8f660078c94ef21ce00f8504ba42 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 frames to the FIFO.
+ 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_;
« no previous file with comments | « media/audio/win/audio_low_latency_input_win_unittest.cc ('k') | media/base/audio_block_fifo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698