OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/mojo/services/mojo_renderer_factory.h" | 5 #include "media/mojo/services/mojo_renderer_factory.h" |
6 | 6 |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "media/mojo/interfaces/media_renderer.mojom.h" | |
9 #include "media/mojo/services/mojo_renderer_impl.h" | 8 #include "media/mojo/services/mojo_renderer_impl.h" |
10 | 9 |
11 namespace media { | 10 namespace media { |
12 | 11 |
13 MojoRendererFactory::MojoRendererFactory( | 12 MojoRendererFactory::MojoRendererFactory( |
14 scoped_ptr<ServiceProvider> service_provider) | 13 scoped_ptr<ServiceProvider> service_provider) |
15 : service_provider_(service_provider.Pass()) { | 14 : service_provider_(service_provider.Pass()) { |
16 DCHECK(service_provider_.get()); | 15 DCHECK(service_provider_.get()); |
17 } | 16 } |
18 | 17 |
19 MojoRendererFactory::~MojoRendererFactory() { | 18 MojoRendererFactory::~MojoRendererFactory() { |
20 } | 19 } |
21 | 20 |
22 scoped_ptr<Renderer> MojoRendererFactory::CreateRenderer( | 21 scoped_ptr<Renderer> MojoRendererFactory::CreateRenderer( |
23 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 22 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
24 AudioRendererSink* /* audio_renderer_sink */, | 23 AudioRendererSink* /* audio_renderer_sink */, |
25 VideoRendererSink* /* video_renderer_sink */) { | 24 VideoRendererSink* /* video_renderer_sink */) { |
26 mojo::MediaRendererPtr mojo_media_renderer; | 25 mojo::MediaRendererPtr mojo_media_renderer; |
27 service_provider_->ConnectToService(&mojo_media_renderer); | 26 service_provider_->ConnectToService(&mojo_media_renderer); |
28 return scoped_ptr<Renderer>( | 27 return scoped_ptr<Renderer>( |
29 new MojoRendererImpl(media_task_runner, mojo_media_renderer.Pass())); | 28 new MojoRendererImpl(media_task_runner, mojo_media_renderer.Pass())); |
30 } | 29 } |
31 | 30 |
32 } // namespace media | 31 } // namespace media |
OLD | NEW |