| 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 #ifndef MEDIA_MOJO_SERVICES_INTERFACE_FACTORY_IMPL_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_INTERFACE_FACTORY_IMPL_H_ |
| 6 #define MEDIA_MOJO_SERVICES_INTERFACE_FACTORY_IMPL_H_ | 6 #define MEDIA_MOJO_SERVICES_INTERFACE_FACTORY_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "media/mojo/features.h" |
| 11 #include "media/mojo/interfaces/interface_factory.mojom.h" | 12 #include "media/mojo/interfaces/interface_factory.mojom.h" |
| 12 #include "media/mojo/services/mojo_cdm_service_context.h" | 13 #include "media/mojo/services/mojo_cdm_service_context.h" |
| 13 #include "mojo/public/cpp/bindings/strong_binding_set.h" | 14 #include "mojo/public/cpp/bindings/strong_binding_set.h" |
| 14 #include "services/service_manager/public/cpp/connector.h" | 15 #include "services/service_manager/public/cpp/connector.h" |
| 15 #include "services/service_manager/public/cpp/service_context_ref.h" | 16 #include "services/service_manager/public/cpp/service_context_ref.h" |
| 16 | 17 |
| 17 namespace media { | 18 namespace media { |
| 18 | 19 |
| 19 class CdmFactory; | 20 class CdmFactory; |
| 20 class MediaLog; | 21 class MediaLog; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 31 ~InterfaceFactoryImpl() final; | 32 ~InterfaceFactoryImpl() final; |
| 32 | 33 |
| 33 // mojom::InterfaceFactory implementation. | 34 // mojom::InterfaceFactory implementation. |
| 34 void CreateAudioDecoder(mojom::AudioDecoderRequest request) final; | 35 void CreateAudioDecoder(mojom::AudioDecoderRequest request) final; |
| 35 void CreateVideoDecoder(mojom::VideoDecoderRequest request) final; | 36 void CreateVideoDecoder(mojom::VideoDecoderRequest request) final; |
| 36 void CreateRenderer(const std::string& audio_device_id, | 37 void CreateRenderer(const std::string& audio_device_id, |
| 37 mojom::RendererRequest request) final; | 38 mojom::RendererRequest request) final; |
| 38 void CreateCdm(mojom::ContentDecryptionModuleRequest request) final; | 39 void CreateCdm(mojom::ContentDecryptionModuleRequest request) final; |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 #if defined(ENABLE_MOJO_RENDERER) | 42 #if BUILDFLAG(ENABLE_MOJO_RENDERER) |
| 42 RendererFactory* GetRendererFactory(); | 43 RendererFactory* GetRendererFactory(); |
| 43 #endif // defined(ENABLE_MOJO_RENDERER) | 44 #endif // BUILDFLAG(ENABLE_MOJO_RENDERER) |
| 44 | 45 |
| 45 #if defined(ENABLE_MOJO_CDM) | 46 #if BUILDFLAG(ENABLE_MOJO_CDM) |
| 46 CdmFactory* GetCdmFactory(); | 47 CdmFactory* GetCdmFactory(); |
| 47 #endif // defined(ENABLE_MOJO_CDM) | 48 #endif // BUILDFLAG(ENABLE_MOJO_CDM) |
| 48 | 49 |
| 49 MojoCdmServiceContext cdm_service_context_; | 50 MojoCdmServiceContext cdm_service_context_; |
| 50 | 51 |
| 51 #if defined(ENABLE_MOJO_AUDIO_DECODER) | 52 #if BUILDFLAG(ENABLE_MOJO_AUDIO_DECODER) |
| 52 mojo::StrongBindingSet<mojom::AudioDecoder> audio_decoder_bindings_; | 53 mojo::StrongBindingSet<mojom::AudioDecoder> audio_decoder_bindings_; |
| 53 #endif // defined(ENABLE_MOJO_AUDIO_DECODER) | 54 #endif // BUILDFLAG(ENABLE_MOJO_AUDIO_DECODER) |
| 54 | 55 |
| 55 #if defined(ENABLE_MOJO_VIDEO_DECODER) | 56 #if BUILDFLAG(ENABLE_MOJO_VIDEO_DECODER) |
| 56 mojo::StrongBindingSet<mojom::VideoDecoder> video_decoder_bindings_; | 57 mojo::StrongBindingSet<mojom::VideoDecoder> video_decoder_bindings_; |
| 57 #endif // defined(ENABLE_MOJO_VIDEO_DECODER) | 58 #endif // BUILDFLAG(ENABLE_MOJO_VIDEO_DECODER) |
| 58 | 59 |
| 59 #if defined(ENABLE_MOJO_RENDERER) | 60 #if BUILDFLAG(ENABLE_MOJO_RENDERER) |
| 60 MediaLog* media_log_; | 61 MediaLog* media_log_; |
| 61 std::unique_ptr<RendererFactory> renderer_factory_; | 62 std::unique_ptr<RendererFactory> renderer_factory_; |
| 62 mojo::StrongBindingSet<mojom::Renderer> renderer_bindings_; | 63 mojo::StrongBindingSet<mojom::Renderer> renderer_bindings_; |
| 63 #endif // defined(ENABLE_MOJO_RENDERER) | 64 #endif // BUILDFLAG(ENABLE_MOJO_RENDERER) |
| 64 | 65 |
| 65 #if defined(ENABLE_MOJO_CDM) | 66 #if BUILDFLAG(ENABLE_MOJO_CDM) |
| 66 std::unique_ptr<CdmFactory> cdm_factory_; | 67 std::unique_ptr<CdmFactory> cdm_factory_; |
| 67 service_manager::mojom::InterfaceProviderPtr interfaces_; | 68 service_manager::mojom::InterfaceProviderPtr interfaces_; |
| 68 mojo::StrongBindingSet<mojom::ContentDecryptionModule> cdm_bindings_; | 69 mojo::StrongBindingSet<mojom::ContentDecryptionModule> cdm_bindings_; |
| 69 #endif // defined(ENABLE_MOJO_CDM) | 70 #endif // BUILDFLAG(ENABLE_MOJO_CDM) |
| 70 | 71 |
| 71 std::unique_ptr<service_manager::ServiceContextRef> connection_ref_; | 72 std::unique_ptr<service_manager::ServiceContextRef> connection_ref_; |
| 72 MojoMediaClient* mojo_media_client_; | 73 MojoMediaClient* mojo_media_client_; |
| 73 | 74 |
| 74 DISALLOW_COPY_AND_ASSIGN(InterfaceFactoryImpl); | 75 DISALLOW_COPY_AND_ASSIGN(InterfaceFactoryImpl); |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 } // namespace media | 78 } // namespace media |
| 78 | 79 |
| 79 #endif // MEDIA_MOJO_SERVICES_INTERFACE_FACTORY_IMPL_H_ | 80 #endif // MEDIA_MOJO_SERVICES_INTERFACE_FACTORY_IMPL_H_ |
| OLD | NEW |