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

Unified Diff: media/filters/source_buffer_stream.h

Issue 10692053: Remove buffer duration calculation from WebMClusterParser and update SourceBufferStream accordingly (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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
Index: media/filters/source_buffer_stream.h
diff --git a/media/filters/source_buffer_stream.h b/media/filters/source_buffer_stream.h
index db2a92f6b856664bf4600a6c0bd004c430903e32..954ead71a685c6c16b0c0d7f9deb117cba6b3844 100644
--- a/media/filters/source_buffer_stream.h
+++ b/media/filters/source_buffer_stream.h
@@ -34,16 +34,17 @@ class MEDIA_EXPORT SourceBufferStream {
~SourceBufferStream();
+ // Signals that the next buffers appended are part of a new media segment
+ // starting at |media_segment_start_time|.
+ void OnNewMediaSegment(base::TimeDelta media_segment_start_time);
+
// Add the |buffers| to the SourceBufferStream. Buffers within the queue are
// expected to be in order, but multiple calls to Append() may add buffers out
// of order or overlapping. Assumes all buffers within |buffers| are in
// presentation order and are non-overlapping.
- // |media_segment_start_time| refers to the starting timestamp for the media
- // segment to which these buffers belong.
// Returns true if Append() was successful, false if |buffers| are not added.
// TODO(vrk): Implement garbage collection. (crbug.com/125070)
- bool Append(const BufferQueue& buffers,
- base::TimeDelta media_segment_start_time);
+ bool Append(const BufferQueue& buffers);
// Changes the SourceBufferStream's state so that it will start returning
// buffers starting from the closest keyframe before |timestamp|.
@@ -103,11 +104,11 @@ class MEDIA_EXPORT SourceBufferStream {
// the |selected_range_| seeks forward to the next keyframe after (or at) the
// next buffer timestamp and the overlapped buffers are deleted. But for
// smooth playback between the old data to the new data's keyframe, some of
- // these |deleted_buffers| may be temporarily saved into |track_buffer_|.
- // UpdateTrackBuffer() takes these |deleted_buffers| and decides whether it
+ // these |deleted_buffers_| may be temporarily saved into |track_buffer_|.
+ // UpdateTrackBuffer() takes these |deleted_buffers_| and decides whether it
// wants to save any buffers into |track_buffer_|.
// TODO(vrk): This is a little crazy! Ideas for cleanup in crbug.com/129623.
- void UpdateTrackBuffer(const BufferQueue& deleted_buffers);
+ void UpdateTrackBuffer();
// Checks to see if |range_with_new_buffers_itr| can be merged with the range
// next to it, and merges them if so.
@@ -158,6 +159,20 @@ class MEDIA_EXPORT SourceBufferStream {
// EOS buffers for read requests beyond the buffered data. False initially.
bool end_of_stream_;
+ // True if the next buffer that would have been returned from GetNextBuffer()
+ // was deleted during an Append(). Should never be true outside of an
+ // Append() call.
+ bool deleted_next_buffer_;
+ // Candidates for |track_buffer_|. Should always be empty outside of an
+ // Append() call.
+ BufferQueue deleted_buffers_;
+
+ // The start time of the current media segment being appended.
+ base::TimeDelta media_segment_start_time_;
+
+ // Points to the range containing the current media segment being appended.
+ RangeList::iterator range_for_next_append_;
+
DISALLOW_COPY_AND_ASSIGN(SourceBufferStream);
};

Powered by Google App Engine
This is Rietveld 408576698