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

Unified Diff: media/filters/source_buffer_stream.h

Issue 2385423002: MediaSource: Fix CHECK crash in append fudge room edge case. (Closed)
Patch Set: Rebase and feedback Created 4 years, 2 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') | no next file with comments »
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 52d12aaf7e2ab280a306e0badf264772c983be2e..7322bd79df22f8d02385328835d3d5eff121ad91 100644
--- a/media/filters/source_buffer_stream.h
+++ b/media/filters/source_buffer_stream.h
@@ -79,7 +79,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 garbage collection. (crbug.com/125070)
bool Append(const BufferQueue& buffers);
// Removes buffers between |start| and |end| according to the steps
@@ -240,6 +239,9 @@ class MEDIA_EXPORT SourceBufferStream {
// Resets this stream back to an unseeked state.
void ResetSeekState();
+ // Reset state tracking various metadata about the last appended buffer.
+ void ResetLastAppendedState();
+
// Returns true if |seek_timestamp| refers to the beginning of the first range
// in |ranges_|, false otherwise or if |ranges_| is empty.
bool ShouldSeekToStartOfBuffered(base::TimeDelta seek_timestamp) const;
@@ -321,6 +323,14 @@ class MEDIA_EXPORT SourceBufferStream {
bool exclude_start,
BufferQueue* deleted_buffers);
+ // Helper function used by RemoveInternal() to evaluate whether remove will
+ // disrupt the last appended GOP. If disruption is expected, reset state
+ // tracking the last append. This will trigger frame filtering in Append()
+ // until a new key frame is provided.
+ void UpdateLastAppendStateForRemove(DecodeTimestamp remove_start,
+ DecodeTimestamp remove_end,
+ bool exclude_start);
+
Type GetType() const;
// See GetNextBuffer() for additional details. This method handles splice
« no previous file with comments | « no previous file | media/filters/source_buffer_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698