summaryrefslogtreecommitdiffstats
path: root/media/base/renderer.h
diff options
context:
space:
mode:
authorxhwang <xhwang@chromium.org>2014-10-03 00:10:01 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-03 07:10:12 +0000
commitabd95fd44fb0b36b06fa3a84f39472cff4d6386a (patch)
tree75dbc2372b4670b51952e8ff69e71557df2cc9d9 /media/base/renderer.h
parent9b2e921f0b87db7da6533b3351d6afc9084db292 (diff)
downloadchromium_src-abd95fd44fb0b36b06fa3a84f39472cff4d6386a.zip
chromium_src-abd95fd44fb0b36b06fa3a84f39472cff4d6386a.tar.gz
chromium_src-abd95fd44fb0b36b06fa3a84f39472cff4d6386a.tar.bz2
media: Pass DemuxerStreamProvider in Renderer::Initialize().
Currently DemuxerStreamProvider is passed in the constructor of Renderer implementations (e.g. RendererImpl and MojoRendererImpl). However, if we want to create the Renderer earlier and pass it to WebMediaPlayerImpl or Pipeline, the DemuxerStreamProvider may not be available yet. Meanwhile, when Renderer is initialized by the Pipeline, DemuxerStreamProvider is always available. This CL moves the DemuxerStreamProvider parameter to Renderer::Initialize() to accommodate the above cases. BUG=416570 TEST=Unit tests updated. Review URL: https://codereview.chromium.org/591203003 Cr-Commit-Position: refs/heads/master@{#298006}
Diffstat (limited to 'media/base/renderer.h')
-rw-r--r--media/base/renderer.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/media/base/renderer.h b/media/base/renderer.h
index af02ba5..78ae043 100644
--- a/media/base/renderer.h
+++ b/media/base/renderer.h
@@ -14,6 +14,7 @@
namespace media {
class MediaKeys;
+class DemuxerStreamProvider;
class MEDIA_EXPORT Renderer {
public:
@@ -24,15 +25,18 @@ class MEDIA_EXPORT Renderer {
// Stops rendering and fires any pending callbacks.
virtual ~Renderer();
- // Initializes the Renderer, executing |init_cb| upon completion.
- // If initialization failed, fires |error_cb| before |init_cb|.
+ // Initializes the Renderer with |demuxer_stream_provider|, executing
+ // |init_cb| upon completion. If initialization failed, fires |error_cb|
+ // before |init_cb|. |demuxer_stream_provider| must be valid throughout the
+ // lifetime of the Renderer object.
//
// Permanent callbacks:
// - |statistics_cb|: Executed periodically with rendering statistics.
// - |time_cb|: Executed whenever time has advanced through rendering.
// - |ended_cb|: Executed when rendering has reached the end of stream.
// - |error_cb|: Executed if any error was encountered during rendering.
- virtual void Initialize(const base::Closure& init_cb,
+ virtual void Initialize(DemuxerStreamProvider* demuxer_stream_provider,
+ const base::Closure& init_cb,
const StatisticsCB& statistics_cb,
const base::Closure& ended_cb,
const PipelineStatusCB& error_cb,