Index: media/base/pipeline_impl.h |
diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h |
index da4f347579c6496e5351893c4eac25c7d4308114..f9d3b7341a684eecc3d49bf18c154f6ec8a0d39f 100644 |
--- a/media/base/pipeline_impl.h |
+++ b/media/base/pipeline_impl.h |
@@ -26,6 +26,7 @@ |
namespace base { |
class SingleThreadTaskRunner; |
+class WaitableEvent; |
} |
namespace media { |
@@ -77,8 +78,9 @@ class TextRenderer; |
class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost { |
public: |
// Constructs a media pipeline that will execute on |task_runner|. |
- PipelineImpl(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
- MediaLog* media_log); |
+ PipelineImpl( |
+ const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
+ MediaLog* media_log); |
~PipelineImpl() override; |
void SetErrorForTesting(PipelineStatus status); |
@@ -87,15 +89,9 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost { |
// Pipeline implementation. |
void Start(Demuxer* demuxer, |
std::unique_ptr<Renderer> renderer, |
- const base::Closure& ended_cb, |
- const PipelineStatusCB& error_cb, |
- const PipelineStatusCB& seek_cb, |
- const PipelineMetadataCB& metadata_cb, |
- const BufferingStateCB& buffering_state_cb, |
- const base::Closure& duration_change_cb, |
- const AddTextTrackCB& add_text_track_cb, |
- const base::Closure& waiting_for_decryption_key_cb) override; |
- void Stop(const base::Closure& stop_cb) override; |
+ Client* client, |
+ const PipelineStatusCB& seek_cb) override; |
+ void Stop() override; |
void Seek(base::TimeDelta time, const PipelineStatusCB& seek_cb) override; |
bool IsRunning() const override; |
double GetPlaybackRate() const override; |
@@ -158,6 +154,9 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost { |
// Callback executed by filters to update statistics. |
void OnUpdateStatistics(const PipelineStatistics& stats_delta); |
+ // Callback executed by renderer when waiting for decryption key. |
+ void OnWaitingForDecryptionKey(); |
+ |
// The following "task" methods correspond to the public methods, but these |
// methods are run as the result of posting a task to the Pipeline's |
// task runner. |
@@ -172,7 +171,7 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost { |
const PipelineStatusCB& seek_sb); |
// Stops and destroys all filters, placing the pipeline in the kStopped state. |
- void StopTask(const base::Closure& stop_cb); |
+ void StopTask(base::WaitableEvent* event); |
// Carries out stopping and destroying all filters, placing the pipeline in |
// the kStopped state. |
@@ -225,18 +224,18 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost { |
// Initiates an asynchronous pause-flush-seek-preroll call sequence |
// executing |done_cb| with the final status when completed. |
void DoSeek(base::TimeDelta seek_timestamp, const PipelineStatusCB& done_cb); |
- |
- // Initiates an asynchronous pause-flush-stop call sequence executing |
- // |done_cb| when completed. |
- void DoStop(const PipelineStatusCB& done_cb); |
- void OnStopCompleted(PipelineStatus status); |
+ // Stops media rendering and signals the |waiter| when done. |
sandersd (OOO until July 31)
2016/05/02 18:37:47
Newline before comment.
alokp
2016/05/02 22:25:17
Done.
|
+ void DoStop(base::WaitableEvent* waiter); |
void ReportMetadata(); |
void BufferingStateChanged(BufferingState new_buffering_state); |
+ // Task runner of the thread on which this class is constructed. |
+ // Also used to post notifications on Pipeline::Client object. |
+ const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
// Task runner used to execute pipeline tasks. |
sandersd (OOO until July 31)
2016/05/02 18:37:47
Newline before comment.
alokp
2016/05/02 22:25:17
Done.
|
- scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
+ const scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; |
// MediaLog to which to log events. |
scoped_refptr<MediaLog> media_log_; |
@@ -294,21 +293,9 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost { |
// Temporary callback used for Start(), Seek(), and Resume(). |
PipelineStatusCB seek_cb_; |
- // Temporary callback used for Stop(). |
- base::Closure stop_cb_; |
- |
// Temporary callback used for Suspend(). |
PipelineStatusCB suspend_cb_; |
- // Permanent callbacks passed in via Start(). |
- base::Closure ended_cb_; |
- PipelineStatusCB error_cb_; |
- PipelineMetadataCB metadata_cb_; |
- BufferingStateCB buffering_state_cb_; |
- base::Closure duration_change_cb_; |
- AddTextTrackCB add_text_track_cb_; |
- base::Closure waiting_for_decryption_key_cb_; |
- |
// Holds the initialized demuxer. Used for seeking. Owned by client. |
Demuxer* demuxer_; |
@@ -317,6 +304,9 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost { |
std::unique_ptr<Renderer> renderer_; |
std::unique_ptr<TextRenderer> text_renderer_; |
+ // Holds the client passed on Start(). |
+ Client* client_; |
+ |
PipelineStatistics statistics_; |
std::unique_ptr<SerialRunner> pending_callbacks_; |