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

Unified Diff: media/filters/source_buffer_stream.h

Issue 10853013: Implement simple garbage collection in SourceBufferStream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT Created 8 years, 4 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 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);
};
« 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