Chromium Code Reviews| Index: media/blink/webmediaplayer_impl.h |
| diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h |
| index 1f08af43f2a18c8ab12a5a68bd95f7f3702a4b59..c4d4ba445d66715f24a0405aef06a398052e4395 100644 |
| --- a/media/blink/webmediaplayer_impl.h |
| +++ b/media/blink/webmediaplayer_impl.h |
| @@ -32,6 +32,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" |
| @@ -184,8 +185,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); |
| @@ -194,6 +193,9 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| void OnAddTextTrack(const TextTrackConfig& config, |
| const AddTextTrackDoneCB& done_cb); |
| + void OnPipelineSeeked(bool time_updated); |
|
DaleCurtis
2016/02/19 23:28:30
Why are these public? Ditto for the rest of the On
sandersd (OOO until July 31)
2016/02/24 00:09:56
Done.
|
| + void OnPipelineSuspended(); |
| + |
| // WebMediaPlayerDelegate::Observer implementation. |
| void OnHidden(bool must_suspend) override; |
| void OnShown() override; |
| @@ -218,19 +220,7 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| #endif |
| private: |
| - // Ask for the pipeline to be suspended, will call Suspend() when ready. |
| - // (Possibly immediately.) |
| - void ScheduleSuspend(); |
| - |
| - // Initiate suspending the pipeline. |
| - void Suspend(); |
| - |
| - // Ask for the pipeline to be resumed, will call Resume() when ready. |
| - // (Possibly immediately.) |
| - void ScheduleResume(); |
| - |
| - // Initiate resuming the pipeline. |
| - void Resume(); |
| + void DoSeek(base::TimeDelta time, bool time_updated); |
| // Ask for the renderer to be restarted (destructed and recreated). |
| void ScheduleRestart(); |
| @@ -291,10 +281,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(); |
| @@ -328,6 +314,7 @@ class MEDIA_BLINK_EXPORT WebMediaPlayerImpl |
| scoped_refptr<base::TaskRunner> worker_task_runner_; |
| scoped_refptr<MediaLog> media_log_; |
| PipelineImpl pipeline_; |
| + PipelineController pipeline_controller_; |
| // The LoadType passed in the |load_type| parameter of the load() call. |
| LoadType load_type_; |
| @@ -351,32 +338,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 |
| @@ -388,14 +359,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_; |