Chromium Code Reviews| Index: media/blink/webmediaplayer_impl.h |
| diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h |
| index 73a1ce9e14c5591a87b77d9144a2cd9bd527d8b9..e390789992423d11b65dc131cd3006ad5b134dde 100644 |
| --- a/media/blink/webmediaplayer_impl.h |
| +++ b/media/blink/webmediaplayer_impl.h |
| @@ -30,6 +30,7 @@ |
| #include "media/blink/webmediaplayer_delegate.h" |
| #include "media/blink/webmediaplayer_params.h" |
| #include "media/blink/webmediaplayer_util.h" |
| +#include "media/filters/pipeline_controller.h" |
| #include "media/renderers/skcanvas_video_renderer.h" |
| #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h" |
| #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" |
| @@ -165,16 +166,6 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| void enteredFullscreen() override; |
| void exitedFullscreen() override; |
| - void OnPipelineSeeked(bool time_changed, PipelineStatus status); |
| - void OnPipelineSuspended(PipelineStatus status); |
| - void OnPipelineEnded(); |
| - void OnPipelineError(PipelineStatus error); |
| - void OnPipelineMetadata(PipelineMetadata metadata); |
| - void OnPipelineBufferingStateChanged(BufferingState buffering_state); |
| - void OnDemuxerOpened(); |
| - void OnAddTextTrack(const TextTrackConfig& config, |
| - const AddTextTrackDoneCB& done_cb); |
| - |
| // WebMediaPlayerDelegate::Observer implementation. |
| void OnHidden(bool must_suspend) override; |
| void OnShown() override; |
| @@ -198,20 +189,23 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| void SetDeviceScaleFactor(float scale_factor); |
| #endif |
| - private: |
| - // Ask for the pipeline to be suspended, will call Suspend() when ready. |
| - // (Possibly immediately.) |
| - void ScheduleSuspend(); |
| + // Called from WebMediaPlayerCast. |
|
DaleCurtis
2016/02/25 01:58:29
Mark with TODO WMPI_CAST make private?
sandersd (OOO until July 31)
2016/02/25 20:33:46
Done.
|
| + void OnPipelineSeeked(bool time_updated); |
| - // Initiate suspending the pipeline. |
| - void Suspend(); |
| + private: |
| + void OnPipelineSuspended(); |
|
DaleCurtis
2016/02/25 01:58:30
Extra space?
sandersd (OOO until July 31)
2016/02/25 20:33:46
The methods were distinguished by whether they wer
|
| - // Ask for the pipeline to be resumed, will call Resume() when ready. |
| - // (Possibly immediately.) |
| - void ScheduleResume(); |
| + void OnPipelineEnded(); |
| + void OnPipelineError(PipelineStatus error); |
| + void OnPipelineMetadata(PipelineMetadata metadata); |
| + void OnPipelineBufferingStateChanged(BufferingState buffering_state); |
| + void OnDemuxerOpened(); |
| + void OnAddTextTrack(const TextTrackConfig& config, |
| + const AddTextTrackDoneCB& done_cb); |
| - // Initiate resuming the pipeline. |
| - void Resume(); |
| + // Actually seek. Avoids causing |should_notify_time_changed_| to be set when |
| + // |renderer_initiated| is true. |
| + void DoSeek(base::TimeDelta time, bool renderer_initiated); |
| // Ask for the renderer to be restarted (destructed and recreated). |
| void ScheduleRestart(); |
| @@ -272,10 +266,6 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| // Called when a CDM has been attached to the |pipeline_|. |
| void OnCdmAttached(bool success); |
| - // Updates |paused_time_| to the current media time with consideration for the |
| - // |ended_| state by clamping current time to duration upon |ended_|. |
| - void UpdatePausedTime(); |
| - |
| // Notifies |delegate_| that playback has started or was paused; also starts |
| // or stops the memory usage reporting timer respectively. |
| void NotifyPlaybackStarted(); |
| @@ -309,6 +299,7 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| scoped_refptr<base::TaskRunner> worker_task_runner_; |
| scoped_refptr<MediaLog> media_log_; |
| PipelineImpl pipeline_; |
|
DaleCurtis
2016/02/25 01:58:30
Might add a comment here that pipeline_controller_
sandersd (OOO until July 31)
2016/02/25 20:33:46
Done.
|
| + PipelineController pipeline_controller_; |
| // The LoadType passed in the |load_type| parameter of the load() call. |
| LoadType load_type_; |
| @@ -332,32 +323,16 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| // clock can creep forward a little bit while the asynchronous |
| // SetPlaybackRate(0) is being executed. |
| double playback_rate_; |
| + |
| + // Set while paused. |paused_time_| is only valid when |paused_| is true. |
| bool paused_; |
| base::TimeDelta paused_time_; |
| - bool seeking_; |
| - // Set when seeking (|seeking_| is true) or resuming. |
| + // Set when starting, seeking, and resuming (all of which require a Pipeline |
| + // seek). |seek_time_| is only valid when |seeking_| is true. |
| + bool seeking_; |
| base::TimeDelta seek_time_; |
| - // Set when a suspend is required but another suspend or seek is in progress. |
| - bool pending_suspend_; |
| - |
| - // Set when suspending immediately after a seek. The time change will happen |
| - // after Resume(). |
| - bool pending_time_change_; |
| - |
| - // Set when a resume is required but suspending is in progress. |
| - bool pending_resume_; |
| - |
| - // Set for the entire period between suspend starting and resume completing. |
| - bool suspending_; |
| - |
| - // Set while suspending to detect double-suspend. |
| - bool suspended_; |
| - |
| - // Set while resuming to detect double-resume. |
| - bool resuming_; |
| - |
| // Set when doing a restart (a suspend and resume in sequence) of the pipeline |
| // in order to destruct and reinitialize the decoders. This is separate from |
| // |pending_resume_| and |pending_suspend_| because they can be elided in |
| @@ -369,14 +344,6 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| // see http://crbug.com/409280 |
| bool ended_; |
| - // Indicates that a seek is queued after the current seek completes or, if the |
| - // pipeline is suspended, after it resumes. Only the last queued seek will |
| - // have any effect. |
| - bool pending_seek_; |
| - |
| - // |pending_seek_time_| is meaningless when |pending_seek_| is false. |
| - base::TimeDelta pending_seek_time_; |
| - |
| // Tracks whether to issue time changed notifications during buffering state |
| // changes. |
| bool should_notify_time_changed_; |