Index: media/filters/source_buffer_stream.h |
diff --git a/media/filters/source_buffer_stream.h b/media/filters/source_buffer_stream.h |
index 1c72c238f2b30d1acd4fe147c91f63225ed5d9db..e67a84d0a7a56f01f905d56ddb716029d718a33e 100644 |
--- a/media/filters/source_buffer_stream.h |
+++ b/media/filters/source_buffer_stream.h |
@@ -103,8 +103,14 @@ class MEDIA_EXPORT SourceBufferStream { |
base::TimeDelta GetMaxInterbufferDistance() const; |
private: |
+ friend class SourceBufferStreamTest; |
typedef std::list<SourceBufferRange*> RangeList; |
+ void set_memory_limit(int memory_limit) { memory_limit_ = memory_limit; } |
+ |
+ // Frees up space if the SourceBufferStream is taking up too much memory. |
+ void GarbageCollectIfNeeded(); |
+ |
// Appends |new_buffers| into |range_for_new_buffers_itr|, handling start and |
// end overlaps if necessary. |
// |deleted_next_buffer| is an output parameter that is true if the next |
@@ -252,6 +258,9 @@ class MEDIA_EXPORT SourceBufferStream { |
// Stores the largest distance between two adjacent buffers in this stream. |
base::TimeDelta max_interbuffer_distance_; |
+// The maximum amount of data in bytes the stream will keep in memory. |
+ int memory_limit_; |
+ |
DISALLOW_COPY_AND_ASSIGN(SourceBufferStream); |
}; |