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/clients/mojo_renderer_factory.h" | 5 #include "media/mojo/clients/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/clients/mojo_renderer.h" | 8 #include "media/mojo/clients/mojo_renderer.h" |
9 #include "media/renderers/video_overlay_factory.h" | 9 #include "media/renderers/video_overlay_factory.h" |
10 #include "services/service_manager/public/cpp/connect.h" | 10 #include "services/service_manager/public/cpp/connect.h" |
11 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" | 11 #include "services/service_manager/public/interfaces/interface_provider.mojom.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 | 14 |
15 MojoRendererFactory::MojoRendererFactory( | 15 MojoRendererFactory::MojoRendererFactory( |
16 const GetGpuFactoriesCB& get_gpu_factories_cb, | 16 const GetGpuFactoriesCB& get_gpu_factories_cb, |
17 shell::mojom::InterfaceProvider* interface_provider) | 17 service_manager::mojom::InterfaceProvider* interface_provider) |
18 : get_gpu_factories_cb_(get_gpu_factories_cb), | 18 : get_gpu_factories_cb_(get_gpu_factories_cb), |
19 interface_provider_(interface_provider) { | 19 interface_provider_(interface_provider) { |
20 DCHECK(interface_provider_); | 20 DCHECK(interface_provider_); |
21 } | 21 } |
22 | 22 |
23 MojoRendererFactory::~MojoRendererFactory() {} | 23 MojoRendererFactory::~MojoRendererFactory() {} |
24 | 24 |
25 std::unique_ptr<Renderer> MojoRendererFactory::CreateRenderer( | 25 std::unique_ptr<Renderer> MojoRendererFactory::CreateRenderer( |
26 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 26 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
27 const scoped_refptr<base::TaskRunner>& /* worker_task_runner */, | 27 const scoped_refptr<base::TaskRunner>& /* worker_task_runner */, |
28 AudioRendererSink* /* audio_renderer_sink */, | 28 AudioRendererSink* /* audio_renderer_sink */, |
29 VideoRendererSink* video_renderer_sink, | 29 VideoRendererSink* video_renderer_sink, |
30 const RequestSurfaceCB& /* request_surface_cb */) { | 30 const RequestSurfaceCB& /* request_surface_cb */) { |
31 std::unique_ptr<VideoOverlayFactory> overlay_factory; | 31 std::unique_ptr<VideoOverlayFactory> overlay_factory; |
32 | 32 |
33 // |get_gpu_factories_cb_| can be null in the HLS/MediaPlayerRenderer case, | 33 // |get_gpu_factories_cb_| can be null in the HLS/MediaPlayerRenderer case, |
34 // when we do not need to create video overlays. | 34 // when we do not need to create video overlays. |
35 if (!get_gpu_factories_cb_.is_null()) { | 35 if (!get_gpu_factories_cb_.is_null()) { |
36 overlay_factory = | 36 overlay_factory = |
37 base::MakeUnique<VideoOverlayFactory>(get_gpu_factories_cb_.Run()); | 37 base::MakeUnique<VideoOverlayFactory>(get_gpu_factories_cb_.Run()); |
38 } | 38 } |
39 | 39 |
40 mojom::RendererPtr renderer_ptr; | 40 mojom::RendererPtr renderer_ptr; |
41 shell::GetInterface<mojom::Renderer>(interface_provider_, &renderer_ptr); | 41 service_manager::GetInterface<mojom::Renderer>(interface_provider_, |
| 42 &renderer_ptr); |
42 | 43 |
43 return std::unique_ptr<Renderer>( | 44 return std::unique_ptr<Renderer>( |
44 new MojoRenderer(media_task_runner, std::move(overlay_factory), | 45 new MojoRenderer(media_task_runner, std::move(overlay_factory), |
45 video_renderer_sink, std::move(renderer_ptr))); | 46 video_renderer_sink, std::move(renderer_ptr))); |
46 } | 47 } |
47 | 48 |
48 } // namespace media | 49 } // namespace media |
OLD | NEW |