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

Unified Diff: media/blink/webmediaplayer_impl.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/base/media_switches.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.h
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index a20739fdd0493428de4e76e50cb166906d3fd900..1b184a88858d488d68fbde6c0f5684c791cad08d 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -15,6 +15,7 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
+#include "base/memory/memory_pressure_listener.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
@@ -352,6 +353,9 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
void ReportMemoryUsage();
void FinishMemoryUsageReport(int64_t demuxer_memory_usage);
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
+
// Called during OnHidden() when we want a suspended player to enter the
// paused state after some idle timeout.
void ScheduleIdlePauseTimer();
@@ -568,6 +572,8 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
std::unique_ptr<Demuxer> demuxer_;
ChunkDemuxer* chunk_demuxer_;
+ std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
+
BufferedDataSourceHostImpl buffered_data_source_host_;
linked_ptr<UrlIndex> url_index_;
@@ -671,6 +677,12 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// playback optimizations.
base::TimeDelta max_keyframe_distance_to_disable_background_video_;
+ // When MSE memory pressure based garbage collection is enabled, the
+ // |enable_instant_source_buffer_gc| controls whether the GC is done
+ // immediately on memory pressure notification or during the next SourceBuffer
+ // append (slower, but MSE spec compliant).
+ bool enable_instant_source_buffer_gc_ = false;
+
// Whether disabled the video track as an optimization.
bool video_track_disabled_ = false;
« no previous file with comments | « media/base/media_switches.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698