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/filters/context_3d.h" |
11 | 12 |
12 namespace base { | 13 namespace base { |
13 class SingleThreadTaskRunner; | 14 class SingleThreadTaskRunner; |
14 } | 15 } |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 class WebContentDecryptionModule; | 18 class WebContentDecryptionModule; |
18 class WebMediaPlayerClient; | 19 class WebMediaPlayerClient; |
19 } | 20 } |
20 | 21 |
21 namespace media { | 22 namespace media { |
22 | 23 |
23 class AudioHardwareConfig; | 24 class AudioHardwareConfig; |
24 class AudioRendererSink; | 25 class AudioRendererSink; |
25 class GpuVideoAcceleratorFactories; | 26 class GpuVideoAcceleratorFactories; |
26 class MediaLog; | 27 class MediaLog; |
27 | 28 |
28 // Holds parameters for constructing WebMediaPlayerImpl without having | 29 // Holds parameters for constructing WebMediaPlayerImpl without having |
29 // to plumb arguments through various abstraction layers. | 30 // to plumb arguments through various abstraction layers. |
30 class MEDIA_EXPORT WebMediaPlayerParams { | 31 class MEDIA_EXPORT WebMediaPlayerParams { |
31 public: | 32 public: |
32 typedef base::Callback<void(const base::Closure&)> DeferLoadCB; | 33 typedef base::Callback<void(const base::Closure&)> DeferLoadCB; |
| 34 typedef base::Callback<Context3D()> Context3DCB; |
33 | 35 |
34 // |defer_load_cb|, |audio_renderer_sink|, and |compositor_task_runner| may be | 36 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and |
35 // null. | 37 // |context_3d_cb| may be null. |
36 WebMediaPlayerParams( | 38 WebMediaPlayerParams( |
37 const DeferLoadCB& defer_load_cb, | 39 const DeferLoadCB& defer_load_cb, |
38 const scoped_refptr<AudioRendererSink>& audio_renderer_sink, | 40 const scoped_refptr<AudioRendererSink>& audio_renderer_sink, |
39 const AudioHardwareConfig& audio_hardware_config, | 41 const AudioHardwareConfig& audio_hardware_config, |
40 const scoped_refptr<MediaLog>& media_log, | 42 const scoped_refptr<MediaLog>& media_log, |
41 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, | 43 const scoped_refptr<GpuVideoAcceleratorFactories>& gpu_factories, |
42 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 44 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
43 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, | 45 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, |
| 46 const Context3DCB& context_3d, |
44 blink::WebContentDecryptionModule* initial_cdm); | 47 blink::WebContentDecryptionModule* initial_cdm); |
45 | 48 |
46 ~WebMediaPlayerParams(); | 49 ~WebMediaPlayerParams(); |
47 | 50 |
48 base::Callback<void(const base::Closure&)> defer_load_cb() const { | 51 DeferLoadCB defer_load_cb() const { return defer_load_cb_; } |
49 return defer_load_cb_; | |
50 } | |
51 | 52 |
52 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const { | 53 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const { |
53 return audio_renderer_sink_; | 54 return audio_renderer_sink_; |
54 } | 55 } |
55 | 56 |
56 const AudioHardwareConfig& audio_hardware_config() const { | 57 const AudioHardwareConfig& audio_hardware_config() const { |
57 return audio_hardware_config_; | 58 return audio_hardware_config_; |
58 } | 59 } |
59 | 60 |
60 const scoped_refptr<MediaLog>& media_log() const { | 61 const scoped_refptr<MediaLog>& media_log() const { |
(...skipping 12 matching lines...) Expand all Loading... |
73 | 74 |
74 const scoped_refptr<base::SingleThreadTaskRunner>& | 75 const scoped_refptr<base::SingleThreadTaskRunner>& |
75 compositor_task_runner() const { | 76 compositor_task_runner() const { |
76 return compositor_task_runner_; | 77 return compositor_task_runner_; |
77 } | 78 } |
78 | 79 |
79 blink::WebContentDecryptionModule* initial_cdm() const { | 80 blink::WebContentDecryptionModule* initial_cdm() const { |
80 return initial_cdm_; | 81 return initial_cdm_; |
81 } | 82 } |
82 | 83 |
| 84 Context3DCB context_3d_cb() const { return context_3d_cb_; } |
| 85 |
83 private: | 86 private: |
84 base::Callback<void(const base::Closure&)> defer_load_cb_; | 87 DeferLoadCB defer_load_cb_; |
85 scoped_refptr<AudioRendererSink> audio_renderer_sink_; | 88 scoped_refptr<AudioRendererSink> audio_renderer_sink_; |
86 const AudioHardwareConfig& audio_hardware_config_; | 89 const AudioHardwareConfig& audio_hardware_config_; |
87 scoped_refptr<MediaLog> media_log_; | 90 scoped_refptr<MediaLog> media_log_; |
88 scoped_refptr<GpuVideoAcceleratorFactories> gpu_factories_; | 91 scoped_refptr<GpuVideoAcceleratorFactories> gpu_factories_; |
89 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; | 92 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; |
90 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; | 93 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; |
| 94 Context3DCB context_3d_cb_; |
91 blink::WebContentDecryptionModule* initial_cdm_; | 95 blink::WebContentDecryptionModule* initial_cdm_; |
92 | 96 |
93 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); | 97 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); |
94 }; | 98 }; |
95 | 99 |
96 } // namespace media | 100 } // namespace media |
97 | 101 |
98 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ | 102 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ |
OLD | NEW |