OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 5 #ifndef WEBKIT_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
6 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 6 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "media/filters/gpu_video_decoder.h" | 9 #include "media/filters/gpu_video_decoder.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
12 class AudioRendererSink; | 12 class AudioRendererSink; |
13 class MediaLog; | 13 class MediaLog; |
14 } | 14 } |
15 | 15 |
16 namespace WebKit { | |
17 class WebAudioSourceProvider; | |
18 } | |
19 | |
20 namespace webkit_media { | 16 namespace webkit_media { |
21 | 17 |
22 class MediaStreamClient; | 18 class MediaStreamClient; |
23 | 19 |
24 // Holds parameters for constructing WebMediaPlayerImpl without having | 20 // Holds parameters for constructing WebMediaPlayerImpl without having |
25 // to plumb arguments through various abstraction layers. | 21 // to plumb arguments through various abstraction layers. |
26 class WebMediaPlayerParams { | 22 class WebMediaPlayerParams { |
27 public: | 23 public: |
28 // |media_log| is the only required parameter; all others may be null. | 24 // |media_log| is the only required parameter; all others may be null. |
29 // | |
30 // If provided, |audio_source_provider| and |audio_renderer_sink| arguments | |
31 // must be the same object. | |
32 // | |
33 // TODO(scherkus): Remove WebAudioSourceProvider parameter once we | |
34 // refactor RenderAudioSourceProvider to live under webkit/media/ | |
35 // instead of content/renderer/, see http://crbug.com/136442 | |
36 WebMediaPlayerParams( | 25 WebMediaPlayerParams( |
37 WebKit::WebAudioSourceProvider* audio_source_provider, | |
38 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink, | 26 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink, |
39 const scoped_refptr<media::GpuVideoDecoder::Factories>& gpu_factories, | 27 const scoped_refptr<media::GpuVideoDecoder::Factories>& gpu_factories, |
40 MediaStreamClient* media_stream_client, | 28 MediaStreamClient* media_stream_client, |
41 const scoped_refptr<media::MediaLog>& media_log); | 29 const scoped_refptr<media::MediaLog>& media_log); |
42 ~WebMediaPlayerParams(); | 30 ~WebMediaPlayerParams(); |
43 | 31 |
44 WebKit::WebAudioSourceProvider* audio_source_provider() const { | |
45 return audio_source_provider_; | |
46 } | |
47 | |
48 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const { | 32 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const { |
49 return audio_renderer_sink_; | 33 return audio_renderer_sink_; |
50 } | 34 } |
51 | 35 |
52 const scoped_refptr<media::GpuVideoDecoder::Factories>& | 36 const scoped_refptr<media::GpuVideoDecoder::Factories>& |
53 gpu_factories() const { | 37 gpu_factories() const { |
54 return gpu_factories_; | 38 return gpu_factories_; |
55 } | 39 } |
56 | 40 |
57 MediaStreamClient* media_stream_client() const { | 41 MediaStreamClient* media_stream_client() const { |
58 return media_stream_client_; | 42 return media_stream_client_; |
59 } | 43 } |
60 | 44 |
61 const scoped_refptr<media::MediaLog>& media_log() const { | 45 const scoped_refptr<media::MediaLog>& media_log() const { |
62 return media_log_; | 46 return media_log_; |
63 } | 47 } |
64 | 48 |
65 private: | 49 private: |
66 WebKit::WebAudioSourceProvider* audio_source_provider_; | |
67 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; | 50 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; |
68 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_; | 51 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_; |
69 MediaStreamClient* media_stream_client_; | 52 MediaStreamClient* media_stream_client_; |
70 scoped_refptr<media::MediaLog> media_log_; | 53 scoped_refptr<media::MediaLog> media_log_; |
71 | 54 |
72 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); | 55 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); |
73 }; | 56 }; |
74 | 57 |
75 } // namespace media | 58 } // namespace media |
76 | 59 |
77 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 60 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
OLD | NEW |