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

Unified Diff: media/filters/source_buffer_state.cc

Issue 2605993002: Experiment with more aggressive MSE GC on memory pressure (Closed)
Patch Set: Improve feature handling (CR feedback) 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.cc
diff --git a/media/filters/source_buffer_state.cc b/media/filters/source_buffer_state.cc
index 5d692c44dde081715cc57842c09a438bb2b590dc..c7ec632040435d2a4d0f9bdca15ca6bde4312090 100644
--- a/media/filters/source_buffer_state.cc
+++ b/media/filters/source_buffer_state.cc
@@ -306,6 +306,20 @@ bool SourceBufferState::EvictCodedFrames(DecodeTimestamp media_time,
return success;
}
+void SourceBufferState::OnMemoryPressure(
+ DecodeTimestamp media_time,
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level,
+ bool force_gc) {
+ // Notify video streams about memory pressure first, since video typically
+ // takes up the most memory and that's where we can expect most savings.
+ for (const auto& it : video_streams_)
+ it.second->OnMemoryPressure(media_time, memory_pressure_level, force_gc);
+ for (const auto& it : audio_streams_)
+ it.second->OnMemoryPressure(media_time, memory_pressure_level, force_gc);
+ for (const auto& it : text_streams_)
+ it.second->OnMemoryPressure(media_time, memory_pressure_level, force_gc);
+}
+
Ranges<TimeDelta> SourceBufferState::GetBufferedRanges(TimeDelta duration,
bool ended) const {
RangesList ranges_list;

Powered by Google App Engine
This is Rietveld 408576698