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

Unified Diff: media/filters/chunk_demuxer.cc

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.h ('k') | media/filters/source_buffer_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/chunk_demuxer.cc
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc
index 1edff064182e70886fadbf469cb46652ecad3123..1302aa531a87e405aafd14d75a96ae3bf1001e48 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -125,6 +125,15 @@ bool ChunkDemuxerStream::EvictCodedFrames(DecodeTimestamp media_time,
return stream_->GarbageCollectIfNeeded(media_time, newDataSize);
}
+void ChunkDemuxerStream::OnMemoryPressure(
+ DecodeTimestamp media_time,
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level,
+ bool force_instant_gc) {
+ base::AutoLock auto_lock(lock_);
+ return stream_->OnMemoryPressure(media_time, memory_pressure_level,
+ force_instant_gc);
+}
+
void ChunkDemuxerStream::OnSetDuration(TimeDelta duration) {
base::AutoLock auto_lock(lock_);
stream_->OnSetDuration(duration);
@@ -736,6 +745,19 @@ void ChunkDemuxer::OnSelectedVideoTrackChanged(
}
}
+void ChunkDemuxer::OnMemoryPressure(
+ base::TimeDelta currentMediaTime,
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level,
+ bool force_instant_gc) {
+ DecodeTimestamp media_time_dts =
+ DecodeTimestamp::FromPresentationTime(currentMediaTime);
+ base::AutoLock auto_lock(lock_);
+ for (const auto& itr : source_state_map_) {
+ itr.second->OnMemoryPressure(media_time_dts, memory_pressure_level,
+ force_instant_gc);
+ }
+}
+
bool ChunkDemuxer::EvictCodedFrames(const std::string& id,
base::TimeDelta currentMediaTime,
size_t newDataSize) {
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/source_buffer_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698