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

Unified Diff: webrtc/common_audio/audio_ring_buffer.h

Issue 1252943007: Split MoveReadPosition into Forward and Backward versions. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Descriptive comments. Created 5 years, 5 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 | « no previous file | webrtc/common_audio/audio_ring_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/audio_ring_buffer.h
diff --git a/webrtc/common_audio/audio_ring_buffer.h b/webrtc/common_audio/audio_ring_buffer.h
index 85d2531ad2fcc5af749f3906994fef715b711c06..58e543adeab65420baea29de166c34cfaebf9027 100644
--- a/webrtc/common_audio/audio_ring_buffer.h
+++ b/webrtc/common_audio/audio_ring_buffer.h
@@ -27,20 +27,23 @@ class AudioRingBuffer final {
AudioRingBuffer(size_t channels, size_t max_frames);
~AudioRingBuffer();
- // Copy |data| to the buffer and advance the write pointer. |channels| must
+ // Copies |data| to the buffer and advances the write pointer. |channels| must
// be the same as at creation time.
void Write(const float* const* data, size_t channels, size_t frames);
- // Copy from the buffer to |data| and advance the read pointer. |channels|
+ // Copies from the buffer to |data| and advances the read pointer. |channels|
// must be the same as at creation time.
void Read(float* const* data, size_t channels, size_t frames);
size_t ReadFramesAvailable() const;
size_t WriteFramesAvailable() const;
- // Positive values advance the read pointer and negative values withdraw
- // the read pointer (i.e. flush and stuff the buffer respectively.)
- void MoveReadPosition(int frames);
+ // Moves the read position. The forward version advances the read pointer
+ // towards the write pointer and the backward verison withdraws the read
+ // pointer away from the write pointer (i.e. flushing and stuffing the buffer
+ // respectively.)
+ void MoveReadPositionForward(size_t frames);
+ void MoveReadPositionBackward(size_t frames);
private:
// We don't use a ScopedVector because it doesn't support a specialized
« no previous file with comments | « no previous file | webrtc/common_audio/audio_ring_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698