Index: media/filters/source_buffer_stream.h |
diff --git a/media/filters/source_buffer_stream.h b/media/filters/source_buffer_stream.h |
index 85ff8d00a919b86461243ef3ec6ad82a8ea201ab..be1f6e0f115a1d08ffa96ccc6e9471e097c94103 100644 |
--- a/media/filters/source_buffer_stream.h |
+++ b/media/filters/source_buffer_stream.h |
@@ -90,6 +90,10 @@ class MEDIA_EXPORT SourceBufferStream { |
void Remove(base::TimeDelta start, base::TimeDelta end, |
base::TimeDelta duration); |
+ // Frees up space if the SourceBufferStream is taking up too much memory. |
+ // |media_time| is current playback position. |
+ bool GarbageCollectIfNeeded(DecodeTimestamp media_time); |
+ |
// Changes the SourceBufferStream's state so that it will start returning |
// buffers starting from the closest keyframe before |timestamp|. |
void Seek(base::TimeDelta timestamp); |
@@ -150,19 +154,20 @@ class MEDIA_EXPORT SourceBufferStream { |
private: |
friend class SourceBufferStreamTest; |
- // Frees up space if the SourceBufferStream is taking up too much memory. |
- void GarbageCollectIfNeeded(); |
- |
// Attempts to delete approximately |total_bytes_to_free| amount of data |
// |ranges_|, starting at the front of |ranges_| and moving linearly forward |
// through the buffers. Deletes starting from the back if |reverse_direction| |
- // is true. Returns the number of bytes freed. |
- size_t FreeBuffers(size_t total_bytes_to_free, bool reverse_direction); |
+ // is true. |media_time| is current playback position. |
+ // Returns the number of bytes freed. |
+ size_t FreeBuffers(size_t total_bytes_to_free, |
+ DecodeTimestamp media_time, |
+ bool reverse_direction); |
// Attempts to delete approximately |total_bytes_to_free| amount of data from |
// |ranges_|, starting after the last appended buffer before the current |
- // playback position. |
- size_t FreeBuffersAfterLastAppended(size_t total_bytes_to_free); |
+ // playback position |media_time|. |
+ size_t FreeBuffersAfterLastAppended(size_t total_bytes_to_free, |
+ DecodeTimestamp media_time); |
// Gets the removal range to secure |byte_to_free| from |
// [|start_timestamp|, |end_timestamp|). |