Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: media/mojo/services/interface_factory_impl.h

Issue 2643743002: Mojify demuxers and allow running {Chunk/FFmpeg}Demuxer in a Utility Process (Closed)
Patch Set: Rebase and make sure to unbind mojom::DemuxerPtr on the bound thread during termination Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/mojo/services/BUILD.gn ('k') | media/mojo/services/interface_factory_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/interfaces/interface_factory.mojom.h" 11 #include "media/mojo/interfaces/interface_factory.mojom.h"
12 #include "media/mojo/services/mojo_cdm_service_context.h" 12 #include "media/mojo/services/mojo_cdm_service_context.h"
13 #include "media/mojo/services/mojo_demuxer_service_context.h"
13 #include "media/mojo/services/strong_binding_set.h" 14 #include "media/mojo/services/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;
21 class DemuxerFactory;
20 class MediaLog; 22 class MediaLog;
21 class MojoMediaClient; 23 class MojoMediaClient;
22 class RendererFactory; 24 class RendererFactory;
23 25
24 class InterfaceFactoryImpl : public mojom::InterfaceFactory { 26 class InterfaceFactoryImpl : public mojom::InterfaceFactory {
25 public: 27 public:
26 InterfaceFactoryImpl( 28 InterfaceFactoryImpl(
27 service_manager::mojom::InterfaceProviderPtr interfaces, 29 service_manager::mojom::InterfaceProviderPtr interfaces,
28 scoped_refptr<MediaLog> media_log, 30 scoped_refptr<MediaLog> media_log,
29 std::unique_ptr<service_manager::ServiceContextRef> connection_ref, 31 std::unique_ptr<service_manager::ServiceContextRef> connection_ref,
30 MojoMediaClient* mojo_media_client); 32 MojoMediaClient* mojo_media_client);
31 ~InterfaceFactoryImpl() final; 33 ~InterfaceFactoryImpl() final;
32 34
33 // mojom::InterfaceFactory implementation. 35 // mojom::InterfaceFactory implementation.
36 void CreateDemuxer(mojom::DemuxerRequest request) final;
37 void CreateSourceBuffer(mojom::SourceBufferRequest request) final;
34 void CreateAudioDecoder(mojom::AudioDecoderRequest request) final; 38 void CreateAudioDecoder(mojom::AudioDecoderRequest request) final;
35 void CreateVideoDecoder(mojom::VideoDecoderRequest request) final; 39 void CreateVideoDecoder(mojom::VideoDecoderRequest request) final;
36 void CreateRenderer(const std::string& audio_device_id, 40 void CreateRenderer(const std::string& audio_device_id,
37 mojom::RendererRequest request) final; 41 mojom::RendererRequest request) final;
38 void CreateCdm(mojom::ContentDecryptionModuleRequest request) final; 42 void CreateCdm(mojom::ContentDecryptionModuleRequest request) final;
39 43
40 private: 44 private:
41 #if defined(ENABLE_MOJO_RENDERER) 45 #if defined(ENABLE_MOJO_RENDERER)
42 RendererFactory* GetRendererFactory(); 46 RendererFactory* GetRendererFactory();
43 #endif // defined(ENABLE_MOJO_RENDERER) 47 #endif // defined(ENABLE_MOJO_RENDERER)
44 48
45 #if defined(ENABLE_MOJO_CDM) 49 #if defined(ENABLE_MOJO_CDM)
46 CdmFactory* GetCdmFactory(); 50 CdmFactory* GetCdmFactory();
47 #endif // defined(ENABLE_MOJO_CDM) 51 #endif // defined(ENABLE_MOJO_CDM)
48 52
53 #if defined(ENABLE_MOJO_DEMUXER)
54 DemuxerFactory* GetDemuxerFactory();
55 #endif // defined(ENABLE_MOJO_DEMUXER)
56
49 MojoCdmServiceContext cdm_service_context_; 57 MojoCdmServiceContext cdm_service_context_;
50 58
59 MojoDemuxerServiceContext demuxer_service_context_;
60
51 #if defined(ENABLE_MOJO_AUDIO_DECODER) 61 #if defined(ENABLE_MOJO_AUDIO_DECODER)
52 StrongBindingSet<mojom::AudioDecoder> audio_decoder_bindings_; 62 StrongBindingSet<mojom::AudioDecoder> audio_decoder_bindings_;
53 #endif // defined(ENABLE_MOJO_AUDIO_DECODER) 63 #endif // defined(ENABLE_MOJO_AUDIO_DECODER)
54 64
55 #if defined(ENABLE_MOJO_VIDEO_DECODER) 65 #if defined(ENABLE_MOJO_VIDEO_DECODER)
56 StrongBindingSet<mojom::VideoDecoder> video_decoder_bindings_; 66 StrongBindingSet<mojom::VideoDecoder> video_decoder_bindings_;
57 #endif // defined(ENABLE_MOJO_VIDEO_DECODER) 67 #endif // defined(ENABLE_MOJO_VIDEO_DECODER)
58 68
59 #if defined(ENABLE_MOJO_RENDERER) 69 #if defined(ENABLE_MOJO_RENDERER)
60 std::unique_ptr<RendererFactory> renderer_factory_; 70 std::unique_ptr<RendererFactory> renderer_factory_;
61 StrongBindingSet<mojom::Renderer> renderer_bindings_; 71 StrongBindingSet<mojom::Renderer> renderer_bindings_;
62 #endif // defined(ENABLE_MOJO_RENDERER) 72 #endif // defined(ENABLE_MOJO_RENDERER)
63 73
74 #if defined(ENABLE_MOJO_CDM) || defined(ENABLE_MOJO_DEMUXER)
75 service_manager::mojom::InterfaceProviderPtr interfaces_;
76 #endif
77
64 #if defined(ENABLE_MOJO_CDM) 78 #if defined(ENABLE_MOJO_CDM)
65 std::unique_ptr<CdmFactory> cdm_factory_; 79 std::unique_ptr<CdmFactory> cdm_factory_;
66 service_manager::mojom::InterfaceProviderPtr interfaces_;
67 StrongBindingSet<mojom::ContentDecryptionModule> cdm_bindings_; 80 StrongBindingSet<mojom::ContentDecryptionModule> cdm_bindings_;
68 #endif // defined(ENABLE_MOJO_CDM) 81 #endif // defined(ENABLE_MOJO_CDM)
69 82
83 #if defined(ENABLE_MOJO_DEMUXER)
84 std::unique_ptr<DemuxerFactory> demuxer_factory_;
85 StrongBindingSet<mojom::Demuxer> demuxer_bindings_;
86 StrongBindingSet<mojom::SourceBuffer> source_buffer_bindings_;
87 #endif // defined(ENABLE_MOJO_RENDERER)
88
70 scoped_refptr<MediaLog> media_log_; 89 scoped_refptr<MediaLog> media_log_;
71 std::unique_ptr<service_manager::ServiceContextRef> connection_ref_; 90 std::unique_ptr<service_manager::ServiceContextRef> connection_ref_;
72 MojoMediaClient* mojo_media_client_; 91 MojoMediaClient* mojo_media_client_;
73 92
74 DISALLOW_COPY_AND_ASSIGN(InterfaceFactoryImpl); 93 DISALLOW_COPY_AND_ASSIGN(InterfaceFactoryImpl);
75 }; 94 };
76 95
77 } // namespace media 96 } // namespace media
78 97
79 #endif // MEDIA_MOJO_SERVICES_INTERFACE_FACTORY_IMPL_H_ 98 #endif // MEDIA_MOJO_SERVICES_INTERFACE_FACTORY_IMPL_H_
OLDNEW
« no previous file with comments | « media/mojo/services/BUILD.gn ('k') | media/mojo/services/interface_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698