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

Unified Diff: media/base/pipeline_impl.h

Issue 1904793002: Move Pipeline permanent callbacks into Pipeline::Client interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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
Index: media/base/pipeline_impl.h
diff --git a/media/base/pipeline_impl.h b/media/base/pipeline_impl.h
index da4f347579c6496e5351893c4eac25c7d4308114..810409d014c0c5b8e4aebe3fb8239870cee34a26 100644
--- a/media/base/pipeline_impl.h
+++ b/media/base/pipeline_impl.h
@@ -77,8 +77,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,14 +88,8 @@ 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;
+ Client* client,
+ const PipelineStatusCB& seek_cb) override;
void Stop(const base::Closure& stop_cb) override;
void Seek(base::TimeDelta time, const PipelineStatusCB& seek_cb) override;
bool IsRunning() const override;
@@ -158,6 +153,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.
@@ -235,8 +233,11 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost {
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.
- 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_;
@@ -300,15 +301,6 @@ class MEDIA_EXPORT PipelineImpl : public Pipeline, public DemuxerHost {
// 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 +309,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_;
« media/base/pipeline.h ('K') | « media/base/pipeline.h ('k') | media/base/pipeline_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698