OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/gpu/gpu_process_control_impl.h" | 5 #include "content/gpu/gpu_process_control_impl.h" |
6 | 6 |
7 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 7 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "content/public/common/content_client.h" |
10 #include "media/mojo/services/mojo_media_application_factory.h" | 11 #include "media/mojo/services/mojo_media_application_factory.h" |
| 12 #if defined(OS_ANDROID) |
| 13 #include "media/base/android/media_client_android.h" |
| 14 #endif |
11 #endif | 15 #endif |
12 | 16 |
13 namespace content { | 17 namespace content { |
14 | 18 |
15 GpuProcessControlImpl::GpuProcessControlImpl() {} | 19 GpuProcessControlImpl::GpuProcessControlImpl() {} |
16 | 20 |
17 GpuProcessControlImpl::~GpuProcessControlImpl() {} | 21 GpuProcessControlImpl::~GpuProcessControlImpl() {} |
18 | 22 |
19 void GpuProcessControlImpl::RegisterApplicationFactories( | 23 void GpuProcessControlImpl::RegisterApplicationFactories( |
20 ApplicationFactoryMap* factories) { | 24 ApplicationFactoryMap* factories) { |
21 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) | 25 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) |
| 26 #if defined(OS_ANDROID) |
| 27 // Only set once per process instance. |
| 28 media::SetMediaClientAndroid(GetContentClient()->GetMediaClientAndroid()); |
| 29 #endif |
| 30 |
22 factories->insert(std::make_pair( | 31 factories->insert(std::make_pair( |
23 "mojo:media", base::Bind(&media::CreateMojoMediaApplication))); | 32 "mojo:media", base::Bind(&media::CreateMojoMediaApplication))); |
24 #endif | 33 #endif |
25 } | 34 } |
26 | 35 |
27 } // namespace content | 36 } // namespace content |
OLD | NEW |