OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WEBKIT_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
| 6 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
| 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "media/filters/gpu_video_decoder.h" |
| 10 |
| 11 namespace media { |
| 12 class AudioRendererSink; |
| 13 class MediaLog; |
| 14 } |
| 15 |
| 16 namespace WebKit { |
| 17 class WebAudioSourceProvider; |
| 18 } |
| 19 |
| 20 namespace webkit_media { |
| 21 |
| 22 class MediaStreamClient; |
| 23 |
| 24 // Holds parameters for constructing WebMediaPlayerImpl without having |
| 25 // to plumb arguments through various abstraction layers. |
| 26 class WebMediaPlayerParams { |
| 27 public: |
| 28 // |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( |
| 37 WebKit::WebAudioSourceProvider* audio_source_provider, |
| 38 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink, |
| 39 const scoped_refptr<media::GpuVideoDecoder::Factories>& gpu_factories, |
| 40 MediaStreamClient* media_stream_client, |
| 41 const scoped_refptr<media::MediaLog>& media_log); |
| 42 ~WebMediaPlayerParams(); |
| 43 |
| 44 WebKit::WebAudioSourceProvider* audio_source_provider() const { |
| 45 return audio_source_provider_; |
| 46 } |
| 47 |
| 48 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const { |
| 49 return audio_renderer_sink_; |
| 50 } |
| 51 |
| 52 const scoped_refptr<media::GpuVideoDecoder::Factories>& |
| 53 gpu_factories() const { |
| 54 return gpu_factories_; |
| 55 } |
| 56 |
| 57 MediaStreamClient* media_stream_client() const { |
| 58 return media_stream_client_; |
| 59 } |
| 60 |
| 61 const scoped_refptr<media::MediaLog>& media_log() const { |
| 62 return media_log_; |
| 63 } |
| 64 |
| 65 private: |
| 66 WebKit::WebAudioSourceProvider* audio_source_provider_; |
| 67 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; |
| 68 scoped_refptr<media::GpuVideoDecoder::Factories> gpu_factories_; |
| 69 MediaStreamClient* media_stream_client_; |
| 70 scoped_refptr<media::MediaLog> media_log_; |
| 71 |
| 72 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); |
| 73 }; |
| 74 |
| 75 } // namespace media |
| 76 |
| 77 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
OLD | NEW |