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

Unified Diff: media/base/audio_splicer.h

Issue 240123004: Simplify AudioSplicer logic which slots buffers before or after a splice point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 6 years, 8 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 | media/base/audio_splicer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_splicer.h
diff --git a/media/base/audio_splicer.h b/media/base/audio_splicer.h
index 4d484d6de8893326c3529dcc2268519ddafdd663..389607ae2c2cc1046b6ba6ac79711a5b315907c5 100644
--- a/media/base/audio_splicer.h
+++ b/media/base/audio_splicer.h
@@ -45,10 +45,15 @@ class MEDIA_EXPORT AudioSplicer {
// should only be called if HasNextBuffer() returns true.
scoped_refptr<AudioBuffer> GetNextBuffer();
- // Indicates that overlapping buffers are coming up and should be crossfaded.
- // Once set, all buffers encountered after |splice_timestamp| will be queued
- // internally until at least 5ms of overlapping buffers are received (or end
- // of stream, whichever comes first).
+ // Indicates an upcoming splice point. All buffers overlapping or after the
+ // |splice_timestamp| will be considered as "before the splice." Clients must
+ // then call SetSpliceTimestamp(kNoTimestamp()) to signal that future buffers
+ // should be considered as "after the splice."
+ //
+ // Once |kCrossfadeDurationInMilliseconds| of buffers "after the splice" or
+ // end of stream has been received, the "after" buffers will be crossfaded
+ // with all "before" buffers which overlap them. "before" buffers outside
+ // of the overlap range will be discarded.
void SetSpliceTimestamp(base::TimeDelta splice_timestamp);
private:
@@ -101,6 +106,10 @@ class MEDIA_EXPORT AudioSplicer {
scoped_ptr<AudioStreamSanitizer> pre_splice_sanitizer_;
scoped_ptr<AudioStreamSanitizer> post_splice_sanitizer_;
+ // Whether all buffers which should go into |pre_splice_sanitizer_| have been
+ // received. If true, buffers should now be put in |post_splice_sanitizer_|.
+ bool have_all_pre_splice_buffers_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSplicer);
};
« no previous file with comments | « no previous file | media/base/audio_splicer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698