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

Unified Diff: media/filters/source_buffer_state.h

Issue 2605993002: Experiment with more aggressive MSE GC on memory pressure (Closed)
Patch Set: rebase/resolve conflicts 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
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/source_buffer_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/source_buffer_state.h
diff --git a/media/filters/source_buffer_state.h b/media/filters/source_buffer_state.h
index 269cf326d0d5826f886f085c85abb91bcf049cb5..81d50596e4418583f314d020c465e948ccf211de 100644
--- a/media/filters/source_buffer_state.h
+++ b/media/filters/source_buffer_state.h
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/macros.h"
+#include "base/memory/memory_pressure_listener.h"
#include "media/base/audio_codecs.h"
#include "media/base/demuxer.h"
#include "media/base/demuxer_stream.h"
@@ -75,6 +76,17 @@ class MEDIA_EXPORT SourceBufferState {
// https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction
bool EvictCodedFrames(DecodeTimestamp media_time, size_t newDataSize);
+ // Gets invoked when the system is experiencing memory pressure, i.e. there's
+ // not enough free memory. The |media_time| is the media playback position at
+ // the time of memory pressure notification (needed for accurate GC). The
+ // |memory_pressure_listener| indicates memory pressure severity. The
+ // |force_instant_gc| is used to force the MSE garbage collection algorithm to
+ // be run right away, without waiting for the next append.
+ void OnMemoryPressure(
+ DecodeTimestamp media_time,
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level,
+ bool force_instant_gc);
+
// Returns true if currently parsing a media segment, or false otherwise.
bool parsing_media_segment() const { return parsing_media_segment_; }
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/source_buffer_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698