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

Unified Diff: media/base/audio_splicer.h

Issue 156783003: Enhance AudioSplicer to crossfade marked splice frames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarity. Created 6 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 | « no previous file | media/base/audio_splicer.cc » ('j') | media/base/audio_splicer.cc » ('J')
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 50445b2d54c889018341772e7d2b686ce1fe84e3..2904fc49d1a26666d837f3289b46714ee2829e6b 100644
--- a/media/base/audio_splicer.h
+++ b/media/base/audio_splicer.h
@@ -29,7 +29,8 @@ class MEDIA_EXPORT AudioSplicer {
// Adds a new buffer full of samples or end of stream buffer to the splicer.
// Returns true if the buffer was accepted. False is returned if an error
// occurred.
- bool AddInput(const scoped_refptr<AudioBuffer>& input);
+ bool AddInput(const scoped_refptr<DecoderBuffer>& origin_buffer,
+ const scoped_refptr<AudioBuffer>& input);
// Returns true if the splicer has a buffer to return.
bool HasNextBuffer() const;
@@ -42,16 +43,17 @@ class MEDIA_EXPORT AudioSplicer {
void AddOutputBuffer(const scoped_refptr<AudioBuffer>& buffer);
AudioTimestampHelper output_timestamp_helper_;
-
- // Minimum gap size needed before the splicer will take action to
- // fill a gap. This avoids periodically inserting and then dropping samples
- // when the buffer timestamps are slightly off because of timestamp rounding
- // in the source content. Unit is frames.
- int min_gap_size_;
-
std::deque<scoped_refptr<AudioBuffer> > output_buffers_;
bool received_end_of_stream_;
+ // Inner splicer for handling splice frames. Responsible for trimming and
+ // crossfading frames before exposing them for consumption by GetNextBuffer().
+ //
+ // Required since input buffers may require trimming arbitrarily large amounts
+ // of samples prior to crossfading. Adding those samples as is to the "outer"
+ // AudioSplicer will result in incorrect timestamp generation.
+ AudioSplicer splice_frame_splicer_;
acolwell GONE FROM CHROMIUM 2014/02/10 20:19:57 How does this compile? This is a recursive declara
DaleCurtis 2014/02/15 01:20:02 As discussed offline, it doesn't, sorry should hav
+
DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSplicer);
};
« no previous file with comments | « no previous file | media/base/audio_splicer.cc » ('j') | media/base/audio_splicer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698