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

Unified Diff: media/blink/webmediaplayer_impl.h

Issue 2618883002: [Media, Video] Enable the video track for a new renderer. (Closed)
Patch Set: Added OnBeforeResume callback 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 54021e6496e7ae93dbdc103fb91cdd3b74747909..225bc0adac125f15a3ba3df01d6d46d4240e7f9a 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -251,6 +251,8 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
void DisableOverlay();
void OnPipelineSuspended();
+ void OnBeforePipelineResume();
+ void OnPipelineResumed();
void OnDemuxerOpened();
// Pipeline::Client overrides.
@@ -374,6 +376,22 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// Whether the media should be paused when hidden.
bool ShouldPauseWhenHidden() const;
+ // Whether the video track should be disabled when hidden.
+ bool ShouldDisableVideoWhenHidden() const;
+
+ // Disables the video track to save power if possible.
+ // Must be called when the video was hidden and also when pipeline seeked or
+ // resumed if the video is hidden.
+ void DisableVideoTrackIfNeeded();
+
+ // Enables the video track if it was disabled before to save power,
+ // if possible.
+ // Must be called when the video was shown and also when pipeline seeked or
+ // resumed if the video is shown.
+ // Must also be called when the pipeline is about to resume, see
+ // https://crbug.com/678374.
sandersd (OOO until July 31) 2017/01/10 21:34:37 Somewhat confusing, in particular because resume i
whywhat 2017/01/11 19:41:30 Rephrased the comments, hopefully they are less co
+ void EnableVideoTrackIfNeeded();
+
blink::WebLocalFrame* frame_;
// The playback state last reported to |delegate_|, to avoid setting duplicate
@@ -602,6 +620,12 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// Whether the player is currently in autoplay muted state.
bool autoplay_muted_ = false;
+ // Whether disabled the video track as an optimization.
+ bool video_track_disabled_ = false;
+
+ // Whether the pipeline is being resumed at the moment.
+ bool is_pipeline_resuming_ = false;
+
DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
};
« 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