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

Unified Diff: media/filters/source_buffer_stream.h

Issue 10389185: Implement start, end, and middle overlaps for SourceBufferStream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT Created 8 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 | « no previous file | media/filters/source_buffer_stream.cc » ('j') | media/filters/source_buffer_stream.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_stream.h
diff --git a/media/filters/source_buffer_stream.h b/media/filters/source_buffer_stream.h
index 8e804144bfc688449f84039918063df729b06739..ac60b34f74cad0568f5120f0c47ebed95517335e 100644
--- a/media/filters/source_buffer_stream.h
+++ b/media/filters/source_buffer_stream.h
@@ -35,8 +35,6 @@ class MEDIA_EXPORT SourceBufferStream {
// of order or overlapping. Assumes all buffers within |buffers| are in
// presentation order and are non-overlapping.
// Returns true if Append() was successful, false if |buffers| are not added.
- // TODO(vrk): Implement proper end-overlapping. (crbug.com/125072)
- // This may trigger garbage collection.
// TODO(vrk): Implement garbage collection. (crbug.com/125070)
bool Append(const BufferQueue& buffers);
@@ -58,20 +56,35 @@ class MEDIA_EXPORT SourceBufferStream {
private:
typedef std::list<SourceBufferRange*> RangeList;
+ // Appends |new_buffers| into |range_for_new_buffers_itr|, handling start and
+ // end overlaps if necessary.
+ void InsertIntoExistingRange(
+ const RangeList::iterator& range_for_new_buffers_itr,
+ const BufferQueue& new_buffers);
+
// Resolve overlapping ranges such that no ranges overlap anymore.
- // |range_itr| points to the iterator in |ranges_| immediately after
- // |new_range|. Returns the iterator in |ranges_| immediately after
- // |new_range|, which may be different from the original |range_itr|.
- RangeList::iterator ResolveCompleteOverlaps(
- const RangeList::iterator& range_itr, SourceBufferRange* new_range);
- RangeList::iterator ResolveEndOverlaps(
- const RangeList::iterator& range_itr, SourceBufferRange* new_range);
-
- // Checks to see if the range pointed to by |range_itr| can be appended to the
- // end of |new_range|, and if so, appends the range and updates |ranges_| to
- // reflect this.
+ // |range_with_new_buffers_itr| points to the range that has newly appended
+ // buffers.
+ void ResolveCompleteOverlaps(
+ const RangeList::iterator& range_with_new_buffers_itr);
+ void ResolveEndOverlap(const RangeList::iterator& range_with_new_buffers_itr);
+
+ // Adds buffers to |track_buffer_| and updates |selected_range_| accordingly.
+ // |range_with_new_buffers_itr| points to the range containing the newly
+ // appended buffers.
+ // |deleted_buffers| contains all the buffers that were deleted as a result
+ // of appending new buffers into |range_with_new_buffers_itr|. |next_buffer|
+ // points to the next buffer in |deleted_buffers| that was deleted. Assumes
acolwell GONE FROM CHROMIUM 2012/05/22 19:35:23 The "that was deleted" here confuses me. I don't r
vrk (LEFT CHROMIUM) 2012/05/24 20:06:30 Yeah sorry, I didn't know how to describe this wit
+ // |deleted_buffers| and |next_buffer| are valid.
+ void UpdateTrackBuffer(
+ const RangeList::iterator& range_with_new_buffers_itr,
+ const BufferQueue& deleted_buffers,
+ const BufferQueue::iterator& next_buffer);
+
+ // Checks to see if |range_with_new_buffers_itr| can be merged with the range
+ // next to it, and merges them if so.
void MergeWithAdjacentRangeIfNecessary(
- const RangeList::iterator& range_itr, SourceBufferRange* new_range);
+ const RangeList::iterator& range_with_new_buffers_itr);
// List of disjoint buffered ranges, ordered by start time.
RangeList ranges_;
@@ -92,11 +105,6 @@ class MEDIA_EXPORT SourceBufferStream {
// |track_buffer_| is empty, return buffers from |selected_range_|.
BufferQueue track_buffer_;
- // True if the next buffer after the end of the |track_buffer_| is not
- // buffered yet and we need to wait for the next keyframe after
- // |track_buffer_| to be appended.
- bool waiting_for_keyframe_;
-
DISALLOW_COPY_AND_ASSIGN(SourceBufferStream);
};
« no previous file with comments | « no previous file | media/filters/source_buffer_stream.cc » ('j') | media/filters/source_buffer_stream.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698