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

Unified Diff: media/blink/webmediaplayer_impl.h

Issue 2644723004: [Video] Don't pause video-only elements if they're already paused... (Closed)
Patch Set: Improved comments, extracted method 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 | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | media/blink/webmediaplayer_impl.cc » ('J')
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 af26096083c03d17ae07222189f751904a7ca3c4..15130dea85a50ce4525df335b3717fed2b4df3fa 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -379,17 +379,34 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// Whether the video should be paused when hidden. Uses metadata so has
// meaning only after the pipeline has started, otherwise returns false.
+ // Doesn't check if the video can actually be paused depending on the
+ // pipeline's state.
bool ShouldPauseVideoWhenHidden() const;
// Whether the video track should be disabled when hidden. Uses metadata so
// has meaning only after the pipeline has started, otherwise returns false.
+ // Doesn't check if the video track can actually be disabled depending on the
+ // pipeline's state.
bool ShouldDisableVideoWhenHidden() const;
// Whether the video is suitable for background playback optimizations (either
// pausing it or disabling the video track). Uses metadata so has meaning only
// after the pipeline has started, otherwise returns false.
+ // The logical OR between the two methods above that is also used as their
+ // common implementation.
bool IsBackgroundOptimizationCandidate() const;
+ // If enabling or disabling background video optimization has been delayed,
+ // because of the pipeline not running, seeking or resuming, this method
+ // needs to be called to update the optimization state.
+ void UpdateBackgroundVideoOptimizationState();
+
+ // Pauses a hidden video only player to save power if possible.
+ // Must be called when either of the following happens:
+ // - right after the video was hidden,
+ // - right ater the pipeline has resumed if the video is hidden.
+ void PauseVideoIfNeeded();
+
// Disables the video track to save power if possible.
// Must be called when either of the following happens:
// - right after the video was hidden,
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | media/blink/webmediaplayer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698