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

Unified Diff: media/base/audio_fifo.h

Issue 10915123: Adds media::AudioPullFifo class to Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test Created 8 years, 3 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 | « .gitmodules ('k') | media/base/audio_fifo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_fifo.h
diff --git a/media/base/audio_fifo.h b/media/base/audio_fifo.h
index 8f59ba951dfd5959cd1fefe69c938b5dc649a14a..f16433710e9c61b5311843c5f56d45c8476610d7 100644
--- a/media/base/audio_fifo.h
+++ b/media/base/audio_fifo.h
@@ -21,34 +21,34 @@ class MEDIA_EXPORT AudioFifo {
virtual ~AudioFifo();
// Pushes all audio channel data from |source| to the FIFO.
- // Returns false if the allocated space is not sufficient. Partial data is
- // not written to the FIFO for this overflow case.
- bool Push(const AudioBus* source);
+ // Push() will crash if the allocated space is insufficient.
+ void Push(const AudioBus* source);
// Consumes |frames_to_consume| audio frames from the FIFO and copies
- // them to |destination|.
- // Returns false if the FIFO does not contain |frames_to_consume| frames
- // or if there is not sufficient space in |destination| to store the frames.
- bool Consume(AudioBus* destination, int frames_to_consume);
+ // them to |destination| starting at position |start_frame|.
+ // Consume() will crash if the FIFO does not contain |frames_to_consume|
+ // frames or if there is insufficient space in |destination| to store the
+ // frames.
+ void Consume(AudioBus* destination, int start_frame, int frames_to_consume);
// Empties the FIFO without deallocating any memory.
void Clear();
// Number of actual audio frames in the FIFO.
- int frames_in_fifo() const { return frames_in_fifo_; }
+ int frames() const { return frames_; }
private:
- int max_frames() const { return max_frames_in_fifo_; }
+ int max_frames() const { return max_frames_; }
// The actual FIFO is an audio bus implemented as a ring buffer.
scoped_ptr<AudioBus> audio_bus_;
// Maximum number of elements the FIFO can contain.
// This value is set by |frames| in the constructor.
- const int max_frames_in_fifo_;
+ const int max_frames_;
// Number of actual elements in the FIFO.
- int frames_in_fifo_;
+ int frames_;
// Current read position.
int read_pos_;
« no previous file with comments | « .gitmodules ('k') | media/base/audio_fifo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698