Chromium Code Reviews| 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); |
| }; |