summaryrefslogtreecommitdiffstats
path: root/media/mojo
diff options
context:
space:
mode:
authorxhwang <xhwang@chromium.org>2014-11-13 12:49:31 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-13 20:49:58 +0000
commit94c0bd3df3b03b2b89ba507027bc1de4aad290c3 (patch)
treec8c07668d8f7f0225867b6b832eb6af0c99630cd /media/mojo
parent169a636e64f462fab46da18c97b2b6dc2fb06225 (diff)
downloadchromium_src-94c0bd3df3b03b2b89ba507027bc1de4aad290c3.zip
chromium_src-94c0bd3df3b03b2b89ba507027bc1de4aad290c3.tar.gz
chromium_src-94c0bd3df3b03b2b89ba507027bc1de4aad290c3.tar.bz2
Pass |paint_cb| through media::Renderer::Initialize().
This provides a common path for a media::Renderer implementation to paint video frames through the render process' CC code. There are several options how this callback could be used (or not used): - Call |paint_cb| periodically to render normal video frames. - Call |paint_cb| with a HOLE_FRAME during initialization and during frame size change to support hold punching. - Ignore |paint_cb| if there is no video stream, or if video renderering is handled by the media::Renderer implementation entirely. BUG=432796 Review URL: https://codereview.chromium.org/725573003 Cr-Commit-Position: refs/heads/master@{#304074}
Diffstat (limited to 'media/mojo')
-rw-r--r--media/mojo/services/media_renderer_apptest.cc5
-rw-r--r--media/mojo/services/mojo_renderer_impl.cc6
-rw-r--r--media/mojo/services/mojo_renderer_impl.h5
-rw-r--r--media/mojo/services/mojo_renderer_service.cc6
4 files changed, 13 insertions, 9 deletions
diff --git a/media/mojo/services/media_renderer_apptest.cc b/media/mojo/services/media_renderer_apptest.cc
index 7c88ad8..60d3bd3 100644
--- a/media/mojo/services/media_renderer_apptest.cc
+++ b/media/mojo/services/media_renderer_apptest.cc
@@ -150,8 +150,9 @@ TEST_F(MojoRendererTest, BasicInitialize) {
PipelineStatus expected_error(PIPELINE_OK);
mojo_renderer_impl.Initialize(
stream_provider(), base::MessageLoop::current()->QuitClosure(),
- media::StatisticsCB(), base::Closure(),
- base::Bind(&ErrorCallback, &expected_error), media::BufferingStateCB());
+ media::StatisticsCB(), media::BufferingStateCB(),
+ media::Renderer::PaintCB(), base::Closure(),
+ base::Bind(&ErrorCallback, &expected_error));
base::MessageLoop::current()->Run();
// We expect an error during initialization because MojoRendererService
diff --git a/media/mojo/services/mojo_renderer_impl.cc b/media/mojo/services/mojo_renderer_impl.cc
index 9ed903f..f93bfe1 100644
--- a/media/mojo/services/mojo_renderer_impl.cc
+++ b/media/mojo/services/mojo_renderer_impl.cc
@@ -35,13 +35,15 @@ MojoRendererImpl::~MojoRendererImpl() {
// Connection to |remote_audio_renderer_| will error-out here.
}
+// TODO(xhwang): Support |paint_cb| if needed.
void MojoRendererImpl::Initialize(
DemuxerStreamProvider* demuxer_stream_provider,
const base::Closure& init_cb,
const StatisticsCB& statistics_cb,
+ const BufferingStateCB& buffering_state_cb,
+ const PaintCB& /* paint_cb */,
const base::Closure& ended_cb,
- const PipelineStatusCB& error_cb,
- const BufferingStateCB& buffering_state_cb) {
+ const PipelineStatusCB& error_cb) {
DVLOG(1) << __FUNCTION__;
DCHECK(task_runner_->BelongsToCurrentThread());
DCHECK(demuxer_stream_provider);
diff --git a/media/mojo/services/mojo_renderer_impl.h b/media/mojo/services/mojo_renderer_impl.h
index 24a319b..4b033d8 100644
--- a/media/mojo/services/mojo_renderer_impl.h
+++ b/media/mojo/services/mojo_renderer_impl.h
@@ -43,9 +43,10 @@ class MojoRendererImpl : public Renderer, public mojo::MediaRendererClient {
void Initialize(DemuxerStreamProvider* demuxer_stream_provider,
const base::Closure& init_cb,
const StatisticsCB& statistics_cb,
+ const BufferingStateCB& buffering_state_cb,
+ const PaintCB& paint_cb,
const base::Closure& ended_cb,
- const PipelineStatusCB& error_cb,
- const BufferingStateCB& buffering_state_cb) override;
+ const PipelineStatusCB& error_cb) override;
void Flush(const base::Closure& flush_cb) override;
void StartPlayingFrom(base::TimeDelta time) override;
void SetPlaybackRate(float playback_rate) override;
diff --git a/media/mojo/services/mojo_renderer_service.cc b/media/mojo/services/mojo_renderer_service.cc
index 60266c4..25a812b 100644
--- a/media/mojo/services/mojo_renderer_service.cc
+++ b/media/mojo/services/mojo_renderer_service.cc
@@ -89,7 +89,6 @@ MojoRendererService::MojoRendererService()
task_runner,
base::Bind(&LogMediaSourceError, media_log)).Pass(),
SetDecryptorReadyCB(),
- base::Bind(&PaintNothing),
true,
media_log));
@@ -149,9 +148,10 @@ void MojoRendererService::OnStreamReady(const mojo::Closure& callback) {
base::Bind(
&MojoRendererService::OnRendererInitializeDone, weak_this_, callback),
base::Bind(&MojoRendererService::OnUpdateStatistics, weak_this_),
+ base::Bind(&MojoRendererService::OnBufferingStateChanged, weak_this_),
+ base::Bind(&PaintNothing),
base::Bind(&MojoRendererService::OnRendererEnded, weak_this_),
- base::Bind(&MojoRendererService::OnError, weak_this_),
- base::Bind(&MojoRendererService::OnBufferingStateChanged, weak_this_));
+ base::Bind(&MojoRendererService::OnError, weak_this_));
}
void MojoRendererService::OnRendererInitializeDone(