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/cdm_factory.h" | 8 #include "media/base/cdm_factory.h" |
9 #include "media/base/media_log.h" | 9 #include "media/base/media_log.h" |
10 #include "media/base/renderer_factory.h" | 10 #include "media/base/renderer_factory.h" |
11 #include "media/mojo/services/mojo_cdm_service.h" | 11 #include "media/mojo/services/mojo_cdm_service.h" |
12 #include "media/mojo/services/mojo_media_client.h" | 12 #include "media/mojo/services/mojo_media_client.h" |
13 #include "media/mojo/services/mojo_renderer_service.h" | 13 #include "media/mojo/services/mojo_renderer_service.h" |
14 #include "mojo/shell/public/cpp/app_lifetime_helper.h" | 14 #include "mojo/shell/public/cpp/app_lifetime_helper.h" |
15 #include "mojo/shell/public/interfaces/service_provider.mojom.h" | 15 #include "mojo/shell/public/interfaces/interface_provider.mojom.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 ServiceFactoryImpl::ServiceFactoryImpl( | 19 ServiceFactoryImpl::ServiceFactoryImpl( |
20 mojo::InterfaceRequest<interfaces::ServiceFactory> request, | 20 mojo::InterfaceRequest<interfaces::ServiceFactory> request, |
21 mojo::ServiceProvider* service_provider, | 21 mojo::InterfaceProvider* interfaces, |
22 scoped_refptr<MediaLog> media_log, | 22 scoped_refptr<MediaLog> media_log, |
23 scoped_ptr<mojo::AppRefCount> parent_app_refcount, | 23 scoped_ptr<mojo::AppRefCount> parent_app_refcount, |
24 MojoMediaClient* mojo_media_client) | 24 MojoMediaClient* mojo_media_client) |
25 : binding_(this, std::move(request)), | 25 : binding_(this, std::move(request)), |
26 service_provider_(service_provider), | 26 interfaces_(interfaces), |
27 media_log_(media_log), | 27 media_log_(media_log), |
28 parent_app_refcount_(std::move(parent_app_refcount)), | 28 parent_app_refcount_(std::move(parent_app_refcount)), |
29 mojo_media_client_(mojo_media_client) { | 29 mojo_media_client_(mojo_media_client) { |
30 DVLOG(1) << __FUNCTION__; | 30 DVLOG(1) << __FUNCTION__; |
31 } | 31 } |
32 | 32 |
33 ServiceFactoryImpl::~ServiceFactoryImpl() { | 33 ServiceFactoryImpl::~ServiceFactoryImpl() { |
34 DVLOG(1) << __FUNCTION__; | 34 DVLOG(1) << __FUNCTION__; |
35 } | 35 } |
36 | 36 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 RendererFactory* ServiceFactoryImpl::GetRendererFactory() { | 75 RendererFactory* ServiceFactoryImpl::GetRendererFactory() { |
76 if (!renderer_factory_) { | 76 if (!renderer_factory_) { |
77 renderer_factory_ = mojo_media_client_->CreateRendererFactory(media_log_); | 77 renderer_factory_ = mojo_media_client_->CreateRendererFactory(media_log_); |
78 LOG_IF(ERROR, !renderer_factory_) << "RendererFactory not available."; | 78 LOG_IF(ERROR, !renderer_factory_) << "RendererFactory not available."; |
79 } | 79 } |
80 return renderer_factory_.get(); | 80 return renderer_factory_.get(); |
81 } | 81 } |
82 | 82 |
83 CdmFactory* ServiceFactoryImpl::GetCdmFactory() { | 83 CdmFactory* ServiceFactoryImpl::GetCdmFactory() { |
84 if (!cdm_factory_) { | 84 if (!cdm_factory_) { |
85 cdm_factory_ = mojo_media_client_->CreateCdmFactory(service_provider_); | 85 cdm_factory_ = mojo_media_client_->CreateCdmFactory(interfaces_); |
86 LOG_IF(ERROR, !cdm_factory_) << "CdmFactory not available."; | 86 LOG_IF(ERROR, !cdm_factory_) << "CdmFactory not available."; |
87 } | 87 } |
88 return cdm_factory_.get(); | 88 return cdm_factory_.get(); |
89 } | 89 } |
90 | 90 |
91 } // namespace media | 91 } // namespace media |
OLD | NEW |