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/services/mojo_renderer_impl.h" | 8 #include "media/mojo/services/mojo_renderer_impl.h" |
9 #include "mojo/shell/public/cpp/connect.h" | 9 #include "services/shell/public/cpp/connect.h" |
10 #include "mojo/shell/public/interfaces/interface_provider.mojom.h" | 10 #include "services/shell/public/interfaces/interface_provider.mojom.h" |
11 | 11 |
12 namespace media { | 12 namespace media { |
13 | 13 |
14 MojoRendererFactory::MojoRendererFactory( | 14 MojoRendererFactory::MojoRendererFactory( |
15 mojo::shell::mojom::InterfaceProvider* interface_provider) | 15 mojo::shell::mojom::InterfaceProvider* interface_provider) |
16 : interface_provider_(interface_provider) { | 16 : interface_provider_(interface_provider) { |
17 DCHECK(interface_provider_); | 17 DCHECK(interface_provider_); |
18 } | 18 } |
19 | 19 |
20 MojoRendererFactory::~MojoRendererFactory() { | 20 MojoRendererFactory::~MojoRendererFactory() { |
21 } | 21 } |
22 | 22 |
23 std::unique_ptr<Renderer> MojoRendererFactory::CreateRenderer( | 23 std::unique_ptr<Renderer> MojoRendererFactory::CreateRenderer( |
24 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 24 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
25 const scoped_refptr<base::TaskRunner>& /* worker_task_runner */, | 25 const scoped_refptr<base::TaskRunner>& /* worker_task_runner */, |
26 AudioRendererSink* /* audio_renderer_sink */, | 26 AudioRendererSink* /* audio_renderer_sink */, |
27 VideoRendererSink* /* video_renderer_sink */, | 27 VideoRendererSink* /* video_renderer_sink */, |
28 const RequestSurfaceCB& /* request_surface_cb */) { | 28 const RequestSurfaceCB& /* request_surface_cb */) { |
29 interfaces::RendererPtr renderer_ptr; | 29 interfaces::RendererPtr renderer_ptr; |
30 mojo::GetInterface<interfaces::Renderer>(interface_provider_, &renderer_ptr); | 30 mojo::GetInterface<interfaces::Renderer>(interface_provider_, &renderer_ptr); |
31 | 31 |
32 return std::unique_ptr<Renderer>( | 32 return std::unique_ptr<Renderer>( |
33 new MojoRendererImpl(media_task_runner, std::move(renderer_ptr))); | 33 new MojoRendererImpl(media_task_runner, std::move(renderer_ptr))); |
34 } | 34 } |
35 | 35 |
36 } // namespace media | 36 } // namespace media |
OLD | NEW |