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 #ifndef COMPONENTS_HTML_VIEWER_MEDIA_FACTORY_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_MEDIA_FACTORY_H_ |
6 #define COMPONENTS_HTML_VIEWER_MEDIA_FACTORY_H_ | 6 #define COMPONENTS_HTML_VIEWER_MEDIA_FACTORY_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 class AudioManager; | 35 class AudioManager; |
36 class RestartableAudioRendererSink; | 36 class RestartableAudioRendererSink; |
37 class CdmFactory; | 37 class CdmFactory; |
38 class MediaPermission; | 38 class MediaPermission; |
39 class UrlIndex; | 39 class UrlIndex; |
40 class WebEncryptedMediaClientImpl; | 40 class WebEncryptedMediaClientImpl; |
41 } | 41 } |
42 | 42 |
43 namespace mojo { | 43 namespace mojo { |
44 class ServiceProvider; | 44 class ServiceProvider; |
| 45 namespace shell { |
| 46 namespace mojom { |
45 class Shell; | 47 class Shell; |
46 } | 48 } |
| 49 } |
| 50 } |
47 | 51 |
48 namespace html_viewer { | 52 namespace html_viewer { |
49 | 53 |
50 // Helper class used to create blink::WebMediaPlayer objects. | 54 // Helper class used to create blink::WebMediaPlayer objects. |
51 // This class stores the "global state" shared across all WebMediaPlayer | 55 // This class stores the "global state" shared across all WebMediaPlayer |
52 // instances. | 56 // instances. |
53 class MediaFactory { | 57 class MediaFactory { |
54 public: | 58 public: |
55 MediaFactory( | 59 MediaFactory( |
56 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, | 60 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, |
57 mojo::Shell* shell); | 61 mojo::shell::mojom::Shell* shell); |
58 ~MediaFactory(); | 62 ~MediaFactory(); |
59 | 63 |
60 blink::WebMediaPlayer* CreateMediaPlayer( | 64 blink::WebMediaPlayer* CreateMediaPlayer( |
61 blink::WebLocalFrame* frame, | 65 blink::WebLocalFrame* frame, |
62 const blink::WebURL& url, | 66 const blink::WebURL& url, |
63 blink::WebMediaPlayerClient* client, | 67 blink::WebMediaPlayerClient* client, |
64 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, | 68 blink::WebMediaPlayerEncryptedMediaClient* encrypted_client, |
65 blink::WebContentDecryptionModule* initial_cdm, | 69 blink::WebContentDecryptionModule* initial_cdm, |
66 mojo::Shell* shell); | 70 mojo::shell::mojom::Shell* shell); |
67 | 71 |
68 blink::WebEncryptedMediaClient* GetEncryptedMediaClient(); | 72 blink::WebEncryptedMediaClient* GetEncryptedMediaClient(); |
69 | 73 |
70 private: | 74 private: |
71 media::interfaces::ServiceFactory* GetMediaServiceFactory(); | 75 media::interfaces::ServiceFactory* GetMediaServiceFactory(); |
72 media::MediaPermission* GetMediaPermission(); | 76 media::MediaPermission* GetMediaPermission(); |
73 media::CdmFactory* GetCdmFactory(); | 77 media::CdmFactory* GetCdmFactory(); |
74 | 78 |
75 #if !defined(OS_ANDROID) | 79 #if !defined(OS_ANDROID) |
76 const media::AudioHardwareConfig& GetAudioHardwareConfig(); | 80 const media::AudioHardwareConfig& GetAudioHardwareConfig(); |
77 scoped_refptr<media::RestartableAudioRendererSink> CreateAudioRendererSink(); | 81 scoped_refptr<media::RestartableAudioRendererSink> CreateAudioRendererSink(); |
78 scoped_refptr<base::SingleThreadTaskRunner> GetMediaThreadTaskRunner(); | 82 scoped_refptr<base::SingleThreadTaskRunner> GetMediaThreadTaskRunner(); |
79 | 83 |
80 base::Thread media_thread_; | 84 base::Thread media_thread_; |
81 media::FakeAudioLogFactory fake_audio_log_factory_; | 85 media::FakeAudioLogFactory fake_audio_log_factory_; |
82 scoped_ptr<media::AudioManager> audio_manager_; | 86 scoped_ptr<media::AudioManager> audio_manager_; |
83 media::AudioHardwareConfig audio_hardware_config_; | 87 media::AudioHardwareConfig audio_hardware_config_; |
84 #endif | 88 #endif |
85 | 89 |
86 const bool enable_mojo_media_renderer_; | 90 const bool enable_mojo_media_renderer_; |
87 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; | 91 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; |
88 mojo::Shell* shell_; | 92 mojo::shell::mojom::Shell* shell_; |
89 | 93 |
90 // Lazily initialized objects. | 94 // Lazily initialized objects. |
91 media::interfaces::ServiceFactoryPtr media_service_factory_; | 95 media::interfaces::ServiceFactoryPtr media_service_factory_; |
92 scoped_ptr<media::WebEncryptedMediaClientImpl> web_encrypted_media_client_; | 96 scoped_ptr<media::WebEncryptedMediaClientImpl> web_encrypted_media_client_; |
93 scoped_ptr<media::MediaPermission> media_permission_; | 97 scoped_ptr<media::MediaPermission> media_permission_; |
94 scoped_ptr<media::CdmFactory> cdm_factory_; | 98 scoped_ptr<media::CdmFactory> cdm_factory_; |
95 | 99 |
96 // Media resource cache, lazily initialized. | 100 // Media resource cache, lazily initialized. |
97 linked_ptr<media::UrlIndex> url_index_; | 101 linked_ptr<media::UrlIndex> url_index_; |
98 | 102 |
99 DISALLOW_COPY_AND_ASSIGN(MediaFactory); | 103 DISALLOW_COPY_AND_ASSIGN(MediaFactory); |
100 }; | 104 }; |
101 | 105 |
102 } // namespace html_viewer | 106 } // namespace html_viewer |
103 | 107 |
104 #endif // COMPONENTS_HTML_VIEWER_MEDIA_FACTORY_H_ | 108 #endif // COMPONENTS_HTML_VIEWER_MEDIA_FACTORY_H_ |
OLD | NEW |