OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "media/mojo/interfaces/content_decryption_module.mojom.h" | 6 #include "media/mojo/interfaces/content_decryption_module.mojom.h" |
7 #include "media/mojo/interfaces/media_renderer.mojom.h" | 7 #include "media/mojo/interfaces/media_renderer.mojom.h" |
8 #include "media/mojo/services/mojo_cdm_service_context.h" | 8 #include "media/mojo/services/mojo_cdm_service_context.h" |
9 #include "mojo/application/public/cpp/application_delegate.h" | 9 #include "mojo/application/public/cpp/application_delegate.h" |
10 #include "mojo/application/public/cpp/interface_factory_impl.h" | 10 #include "mojo/application/public/cpp/interface_factory_impl.h" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 | 14 |
| 15 class MediaLog; |
| 16 class RendererFactory; |
| 17 |
15 class MojoMediaApplication | 18 class MojoMediaApplication |
16 : public mojo::ApplicationDelegate, | 19 : public mojo::ApplicationDelegate, |
17 public mojo::InterfaceFactory<mojo::ContentDecryptionModule>, | 20 public mojo::InterfaceFactory<mojo::ContentDecryptionModule>, |
18 public mojo::InterfaceFactory<mojo::MediaRenderer> { | 21 public mojo::InterfaceFactory<mojo::MediaRenderer> { |
19 public: | 22 public: |
20 static GURL AppUrl(); | 23 static GURL AppUrl(); |
21 static scoped_ptr<mojo::ApplicationDelegate> CreateApp(); | 24 static scoped_ptr<mojo::ApplicationDelegate> CreateApp(); |
22 | 25 |
23 MojoMediaApplication(); | 26 MojoMediaApplication(); |
24 ~MojoMediaApplication() final; | 27 ~MojoMediaApplication() final; |
25 | 28 |
26 private: | 29 private: |
27 // mojo::ApplicationDelegate implementation. | 30 // mojo::ApplicationDelegate implementation. |
28 void Initialize(mojo::ApplicationImpl* app) final; | 31 void Initialize(mojo::ApplicationImpl* app) final; |
29 bool ConfigureIncomingConnection( | 32 bool ConfigureIncomingConnection( |
30 mojo::ApplicationConnection* connection) final; | 33 mojo::ApplicationConnection* connection) final; |
31 | 34 |
32 // mojo::InterfaceFactory<mojo::ContentDecryptionModule> implementation. | 35 // mojo::InterfaceFactory<mojo::ContentDecryptionModule> implementation. |
33 void Create( | 36 void Create( |
34 mojo::ApplicationConnection* connection, | 37 mojo::ApplicationConnection* connection, |
35 mojo::InterfaceRequest<mojo::ContentDecryptionModule> request) final; | 38 mojo::InterfaceRequest<mojo::ContentDecryptionModule> request) final; |
36 | 39 |
37 // mojo::InterfaceFactory<mojo::MediaRenderer> implementation. | 40 // mojo::InterfaceFactory<mojo::MediaRenderer> implementation. |
38 void Create(mojo::ApplicationConnection* connection, | 41 void Create(mojo::ApplicationConnection* connection, |
39 mojo::InterfaceRequest<mojo::MediaRenderer> request) final; | 42 mojo::InterfaceRequest<mojo::MediaRenderer> request) final; |
40 | 43 |
| 44 RendererFactory* GetRendererFactory(); |
| 45 |
41 MojoCdmServiceContext cdm_service_context_; | 46 MojoCdmServiceContext cdm_service_context_; |
| 47 scoped_ptr<RendererFactory> renderer_factory_; |
| 48 scoped_refptr<MediaLog> media_log_; |
42 }; | 49 }; |
43 | 50 |
44 } // namespace media | 51 } // namespace media |
OLD | NEW |