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