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 "media/mojo/services/service_factory_impl.h" | 5 #include "media/mojo/services/service_factory_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/media_log.h" | 8 #include "media/base/media_log.h" |
9 #include "media/mojo/services/mojo_media_client.h" | 9 #include "media/mojo/services/mojo_media_client.h" |
10 #include "services/shell/public/interfaces/interface_provider.mojom.h" | 10 #include "services/shell/public/interfaces/interface_provider.mojom.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 namespace media { | 26 namespace media { |
27 | 27 |
28 ServiceFactoryImpl::ServiceFactoryImpl( | 28 ServiceFactoryImpl::ServiceFactoryImpl( |
29 mojo::InterfaceRequest<mojom::ServiceFactory> request, | 29 mojo::InterfaceRequest<mojom::ServiceFactory> request, |
30 shell::mojom::InterfaceProvider* interfaces, | 30 shell::mojom::InterfaceProvider* interfaces, |
31 scoped_refptr<MediaLog> media_log, | 31 scoped_refptr<MediaLog> media_log, |
32 std::unique_ptr<shell::ShellConnectionRef> connection_ref, | 32 std::unique_ptr<shell::ShellConnectionRef> connection_ref, |
33 MojoMediaClient* mojo_media_client) | 33 MojoMediaClient* mojo_media_client) |
34 : binding_(this, std::move(request)), | 34 : binding_(this, std::move(request)), |
| 35 #if defined(ENABLE_MOJO_CDM) |
35 interfaces_(interfaces), | 36 interfaces_(interfaces), |
| 37 #endif |
| 38 #if defined(ENABLE_MOJO_AUDIO_DECODER) || defined(ENABLE_MOJO_CDM) || \ |
| 39 defined(ENABLE_MOJO_RENDERER) |
| 40 mojo_media_client_(mojo_media_client), |
| 41 #endif |
36 media_log_(media_log), | 42 media_log_(media_log), |
37 connection_ref_(std::move(connection_ref)), | 43 connection_ref_(std::move(connection_ref)) { |
38 mojo_media_client_(mojo_media_client) { | |
39 DVLOG(1) << __FUNCTION__; | 44 DVLOG(1) << __FUNCTION__; |
40 } | 45 } |
41 | 46 |
42 ServiceFactoryImpl::~ServiceFactoryImpl() { | 47 ServiceFactoryImpl::~ServiceFactoryImpl() { |
43 DVLOG(1) << __FUNCTION__; | 48 DVLOG(1) << __FUNCTION__; |
44 } | 49 } |
45 | 50 |
46 // mojom::ServiceFactory implementation. | 51 // mojom::ServiceFactory implementation. |
47 | 52 |
48 void ServiceFactoryImpl::CreateAudioDecoder( | 53 void ServiceFactoryImpl::CreateAudioDecoder( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 CdmFactory* ServiceFactoryImpl::GetCdmFactory() { | 124 CdmFactory* ServiceFactoryImpl::GetCdmFactory() { |
120 if (!cdm_factory_) { | 125 if (!cdm_factory_) { |
121 cdm_factory_ = mojo_media_client_->CreateCdmFactory(interfaces_); | 126 cdm_factory_ = mojo_media_client_->CreateCdmFactory(interfaces_); |
122 LOG_IF(ERROR, !cdm_factory_) << "CdmFactory not available."; | 127 LOG_IF(ERROR, !cdm_factory_) << "CdmFactory not available."; |
123 } | 128 } |
124 return cdm_factory_.get(); | 129 return cdm_factory_.get(); |
125 } | 130 } |
126 #endif // defined(ENABLE_MOJO_CDM) | 131 #endif // defined(ENABLE_MOJO_CDM) |
127 | 132 |
128 } // namespace media | 133 } // namespace media |
OLD | NEW |