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

Unified Diff: media/filters/source_buffer_stream.h

Issue 2605993002: Experiment with more aggressive MSE GC on memory pressure (Closed)
Patch Set: nits Created 3 years, 11 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
Index: media/filters/source_buffer_stream.h
diff --git a/media/filters/source_buffer_stream.h b/media/filters/source_buffer_stream.h
index 566477b81bd1120654d65221e9bd2885727aabd8..686bdca55c9334408aaa749c832e2017a0427653 100644
--- a/media/filters/source_buffer_stream.h
+++ b/media/filters/source_buffer_stream.h
@@ -19,6 +19,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/memory/memory_pressure_listener.h"
#include "base/memory/ref_counted.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/media_export.h"
@@ -93,6 +94,11 @@ class MEDIA_EXPORT SourceBufferStream {
bool GarbageCollectIfNeeded(DecodeTimestamp media_time,
size_t newDataSize);
+ void OnMemoryPressure(
Alexei Svitkine (slow) 2017/01/27 18:03:19 Comment?
servolk 2017/01/28 02:23:57 Done.
+ DecodeTimestamp media_time,
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level,
+ bool force_instant_gc);
+
// Changes the SourceBufferStream's state so that it will start returning
// buffers starting from the closest keyframe before |timestamp|.
void Seek(base::TimeDelta timestamp);
@@ -430,6 +436,9 @@ class MEDIA_EXPORT SourceBufferStream {
// Stores the largest distance between two adjacent buffers in this stream.
base::TimeDelta max_interbuffer_distance_;
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level_ =
+ base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE;
+
// The maximum amount of data in bytes the stream will keep in memory.
size_t memory_limit_;

Powered by Google App Engine
This is Rietveld 408576698