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

Unified Diff: media/filters/frame_processor_base.h

Issue 276573002: Add gapless playback support for AAC playback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix msvc error. Created 6 years, 7 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/filters/frame_processor.cc ('k') | media/filters/frame_processor_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/frame_processor_base.h
diff --git a/media/filters/frame_processor_base.h b/media/filters/frame_processor_base.h
index cc143e29d5d3e14dac963c521a8dc0d0ba7f4e7c..cfa78c8467ce8ba9a69ea598d67239702b187051 100644
--- a/media/filters/frame_processor_base.h
+++ b/media/filters/frame_processor_base.h
@@ -154,6 +154,11 @@ class MEDIA_EXPORT FrameProcessorBase {
// http://www.w3.org/TR/media-source/#sourcebuffer-reset-parser-state
void Reset();
+ // Resets the preroll buffer used for partial append window trimming of audio
+ // buffers. Must be called if the audio config is changed between calls to
+ // ProcessFrames().
+ void clear_audio_preroll_buffer() { audio_preroll_buffer_ = NULL; }
+
protected:
typedef std::map<StreamParser::TrackId, MseTrackBuffer*> TrackBufferMap;
@@ -167,6 +172,24 @@ class MEDIA_EXPORT FrameProcessorBase {
// with timestamp |segment_timestamp|.
void NotifyNewMediaSegmentStarting(base::TimeDelta segment_timestamp);
+ // Handles partial append window trimming of |buffer|. Returns true if the
+ // given |buffer| can be partially trimmed or have preroll added; otherwise,
+ // returns false.
+ //
+ // If |buffer| overlaps |append_window_start|, the portion of |buffer| before
+ // |append_window_start| will be marked for post-decode discard. Further, if
+ // |audio_preroll_buffer_| exists and abuts |buffer|, it will be set as
+ // preroll on |buffer| and |audio_preroll_buffer_| will be cleared. If the
+ // preroll buffer does not abut |buffer|, it will be discarded, but not used.
+ //
+ // If |buffer| lies entirely before |append_window_start|, and thus would
+ // normally be discarded, |audio_preroll_buffer_| will be set to |buffer| and
+ // the method will return false.
+ bool HandlePartialAppendWindowTrimming(
+ base::TimeDelta append_window_start,
+ base::TimeDelta append_window_end,
+ const scoped_refptr<StreamParserBuffer>& buffer);
+
// The AppendMode of the associated SourceBuffer.
// See SetSequenceMode() for interpretation of |sequence_mode_|.
// Per http://www.w3.org/TR/media-source/#widl-SourceBuffer-mode:
@@ -183,6 +206,13 @@ class MEDIA_EXPORT FrameProcessorBase {
// short-term plumbing of SetGroupStartTimestampIfInSequenceMode() until
// LegacyFrameProcessor is removed.
base::TimeDelta group_start_timestamp_;
+
+ private:
+ // The last audio buffer seen by the frame processor that was removed because
+ // it was entirely before the start of the append window.
+ scoped_refptr<StreamParserBuffer> audio_preroll_buffer_;
+
+ DISALLOW_COPY_AND_ASSIGN(FrameProcessorBase);
};
} // namespace media
« no previous file with comments | « media/filters/frame_processor.cc ('k') | media/filters/frame_processor_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698