OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BLINK_WEBMEDIAPLAYER_PARAMS_H_ | 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ |
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ | 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
11 #include "media/blink/encrypted_media_player_support.h" | 11 #include "media/blink/encrypted_media_player_support.h" |
12 #include "media/filters/context_3d_provider.h" | |
12 | 13 |
13 namespace base { | 14 namespace base { |
14 class SingleThreadTaskRunner; | 15 class SingleThreadTaskRunner; |
15 } | 16 } |
16 | 17 |
17 namespace blink { | 18 namespace blink { |
18 class WebMediaPlayerClient; | 19 class WebMediaPlayerClient; |
19 } | 20 } |
20 | 21 |
21 namespace media { | 22 namespace media { |
22 class AudioHardwareConfig; | 23 class AudioHardwareConfig; |
23 class AudioRendererSink; | 24 class AudioRendererSink; |
24 class GpuVideoAcceleratorFactories; | 25 class GpuVideoAcceleratorFactories; |
25 class MediaLog; | 26 class MediaLog; |
26 | 27 |
27 // Holds parameters for constructing WebMediaPlayerImpl without having | 28 // Holds parameters for constructing WebMediaPlayerImpl without having |
28 // to plumb arguments through various abstraction layers. | 29 // to plumb arguments through various abstraction layers. |
29 class MEDIA_EXPORT WebMediaPlayerParams { | 30 class MEDIA_EXPORT WebMediaPlayerParams { |
30 public: | 31 public: |
31 // Callback used to create EncryptedMediaPlayerSupport instances. This | 32 // Callback used to create EncryptedMediaPlayerSupport instances. This |
32 // callback must always return a valid EncryptedMediaPlayerSupport object. | 33 // callback must always return a valid EncryptedMediaPlayerSupport object. |
33 typedef base::Callback<scoped_ptr<EncryptedMediaPlayerSupport>( | 34 typedef base::Callback<scoped_ptr<EncryptedMediaPlayerSupport>( |
34 blink::WebMediaPlayerClient*)> EncryptedMediaPlayerSupportCreateCB; | 35 blink::WebMediaPlayerClient*)> EncryptedMediaPlayerSupportCreateCB; |
35 typedef base::Callback<void(const base::Closure&)> DeferLoadCB; | 36 typedef base::Callback<void(const base::Closure&)> DeferLoadCB; |
36 | 37 |
37 // |defer_load_cb|, |audio_renderer_sink|, and |compositor_task_runner| may be | 38 // |defer_load_cb|, |audio_renderer_sink|, and |compositor_task_runner| may be |
scherkus (not reviewing)
2014/10/30 20:40:11
update docs that state that the context provider C
dshwang
2014/10/31 09:29:16
Thank you for checking. Done.
| |
38 // null. | 39 // null. |
39 WebMediaPlayerParams( | 40 WebMediaPlayerParams( |
40 const DeferLoadCB& defer_load_cb, | 41 const DeferLoadCB& defer_load_cb, |
41 const scoped_refptr<AudioRendererSink>& audio_renderer_sink, | 42 const scoped_refptr<AudioRendererSink>& audio_renderer_sink, |
42 const AudioHardwareConfig& audio_hardware_config, | 43 const AudioHardwareConfig& audio_hardware_config, |
43 const scoped_refptr<MediaLog>& media_log, | 44 const scoped_refptr<MediaLog>& media_log, |
44 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, | 45 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, |
45 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 46 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
46 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, | 47 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, |
47 const EncryptedMediaPlayerSupportCreateCB& | 48 const EncryptedMediaPlayerSupportCreateCB& |
48 encrypted_media_player_support_cb, | 49 encrypted_media_player_support_cb, |
50 const Context3DProviderCB& shared_main_thread_context_3d_provider_cb, | |
scherkus (not reviewing)
2014/10/30 20:40:12
naming suggestion: just use "context_3d_provider_c
dshwang
2014/10/31 09:29:16
That's right! Done.
| |
49 blink::WebContentDecryptionModule* initial_cdm); | 51 blink::WebContentDecryptionModule* initial_cdm); |
50 | 52 |
51 ~WebMediaPlayerParams(); | 53 ~WebMediaPlayerParams(); |
52 | 54 |
53 base::Callback<void(const base::Closure&)> defer_load_cb() const { | 55 DeferLoadCB defer_load_cb() const { return defer_load_cb_; } |
54 return defer_load_cb_; | |
55 } | |
56 | 56 |
57 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const { | 57 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const { |
58 return audio_renderer_sink_; | 58 return audio_renderer_sink_; |
59 } | 59 } |
60 | 60 |
61 const AudioHardwareConfig& audio_hardware_config() const { | 61 const AudioHardwareConfig& audio_hardware_config() const { |
62 return audio_hardware_config_; | 62 return audio_hardware_config_; |
63 } | 63 } |
64 | 64 |
65 const scoped_refptr<MediaLog>& media_log() const { | 65 const scoped_refptr<MediaLog>& media_log() const { |
(...skipping 11 matching lines...) Expand all Loading... | |
77 } | 77 } |
78 | 78 |
79 const scoped_refptr<base::SingleThreadTaskRunner>& | 79 const scoped_refptr<base::SingleThreadTaskRunner>& |
80 compositor_task_runner() const { | 80 compositor_task_runner() const { |
81 return compositor_task_runner_; | 81 return compositor_task_runner_; |
82 } | 82 } |
83 | 83 |
84 scoped_ptr<EncryptedMediaPlayerSupport> | 84 scoped_ptr<EncryptedMediaPlayerSupport> |
85 CreateEncryptedMediaPlayerSupport(blink::WebMediaPlayerClient* client) const; | 85 CreateEncryptedMediaPlayerSupport(blink::WebMediaPlayerClient* client) const; |
86 | 86 |
87 Context3DProviderCB shared_main_thread_context_3d_provider_cb() const { | |
88 return shared_main_thread_context_3d_provider_cb_; | |
89 } | |
90 | |
87 private: | 91 private: |
88 base::Callback<void(const base::Closure&)> defer_load_cb_; | 92 DeferLoadCB defer_load_cb_; |
89 scoped_refptr<AudioRendererSink> audio_renderer_sink_; | 93 scoped_refptr<AudioRendererSink> audio_renderer_sink_; |
90 const AudioHardwareConfig& audio_hardware_config_; | 94 const AudioHardwareConfig& audio_hardware_config_; |
91 scoped_refptr<MediaLog> media_log_; | 95 scoped_refptr<MediaLog> media_log_; |
92 scoped_refptr<GpuVideoAcceleratorFactories> gpu_factories_; | 96 scoped_refptr<GpuVideoAcceleratorFactories> gpu_factories_; |
93 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; | 97 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; |
94 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; | 98 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; |
95 EncryptedMediaPlayerSupportCreateCB encrypted_media_player_support_cb_; | 99 EncryptedMediaPlayerSupportCreateCB encrypted_media_player_support_cb_; |
100 Context3DProviderCB shared_main_thread_context_3d_provider_cb_; | |
96 blink::WebContentDecryptionModule* initial_cdm_; | 101 blink::WebContentDecryptionModule* initial_cdm_; |
97 | 102 |
98 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); | 103 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); |
99 }; | 104 }; |
100 | 105 |
101 } // namespace media | 106 } // namespace media |
102 | 107 |
103 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ | 108 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ |
OLD | NEW |