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

Unified Diff: media/filters/source_buffer_state.h

Issue 2605993002: Experiment with more aggressive MSE GC on memory pressure (Closed)
Patch Set: Allow MSE GC to happen in EOS state now 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_state.h
diff --git a/media/filters/source_buffer_state.h b/media/filters/source_buffer_state.h
index 269cf326d0d5826f886f085c85abb91bcf049cb5..ecf0dbc73a5312ebbff6a4286b08772183b72fc1 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"
@@ -69,11 +70,15 @@ class MEDIA_EXPORT SourceBufferState {
// ChunkDemuxerStreams managed by this object.
void Remove(TimeDelta start, TimeDelta end, TimeDelta duration);
- // If the buffer is full, attempts to try to free up space, as specified in
- // the "Coded Frame Eviction Algorithm" in the Media Source Extensions Spec.
- // Returns false iff buffer is still full after running eviction.
- // https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction
- bool EvictCodedFrames(DecodeTimestamp media_time, size_t newDataSize);
+ // Runs the "Coded Frame Eviction Algorithm" from the Media Source Extensions
+ // spec: https://w3c.github.io/media-source/#sourcebuffer-coded-frame-eviction
+ // |eviction_size| is an input parameter specifying how much space we want to
+ // be available in the buffer after eviction.
+ bool EvictCodedFrames(DecodeTimestamp media_time, size_t eviction_size);
+
+ void OnMemoryPressure(
+ DecodeTimestamp media_time,
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
// Returns true if currently parsing a media segment, or false otherwise.
bool parsing_media_segment() const { return parsing_media_segment_; }

Powered by Google App Engine
This is Rietveld 408576698