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

Unified Diff: media/blink/webmediaplayer_impl.h

Issue 2618883002: [Media, Video] Enable the video track for a new renderer. (Closed)
Patch Set: Fixed debug tests 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') | 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 57d9f12effbc848f1356d88f8368644adf245401..274381c4dab02947fc8b3e4afca378c99eae7629 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -249,6 +249,8 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
void DisableOverlay();
void OnPipelineSuspended();
+ void OnBeforePipelineResume();
+ void OnPipelineResumed();
void OnDemuxerOpened();
// Pipeline::Client overrides.
@@ -369,9 +371,30 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl
// is intended for android.
bool DoesOverlaySupportMetadata() const;
- // Whether the media should be paused when hidden.
+ // Whether the media should be paused when hidden. Uses metadata so has
+ // meaning only after the pipeline has started, otherwise returns false.
bool ShouldPauseWhenHidden() const;
+ // Whether the video track should be disabled when hidden. Uses metadata so
+ // has meaning only after the pipeline has started, otherwise returns false.
+ bool ShouldDisableVideoWhenHidden() const;
+
+ // Disables the video track to save power if possible.
+ // Must be called when either of the following happens:
+ // - right after the video was hidden,
+ // - right after the pipeline has started (|seeking_| is used to detect the
+ // when pipeline started) if the video is hidden,
+ // - right ater the pipeline has resumed if the video is hidden.
+ void DisableVideoTrackIfNeeded();
+
+ // Enables the video track if it was disabled before to save power.
+ // Must be called when either of the following happens:
+ // - right after the video was shown,
+ // - right before the pipeline is requested to resume
+ // (see https://crbug.com/678374),
+ // - right after the pipeline has resumed if the video is not hidden.
+ void EnableVideoTrackIfNeeded();
+
blink::WebLocalFrame* frame_;
// The playback state last reported to |delegate_|, to avoid setting duplicate
@@ -600,6 +623,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698