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); |
}; |