| 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 CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 6 #define CONTENT_RENDERER_MEDIA_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 | 10 |
| 11 namespace base { | |
| 12 class MessageLoopProxy; | |
| 13 } | |
| 14 | |
| 15 namespace media { | 11 namespace media { |
| 16 class AudioRendererSink; | 12 class AudioRendererSink; |
| 17 class GpuVideoAcceleratorFactories; | |
| 18 class MediaLog; | |
| 19 } | 13 } |
| 20 | 14 |
| 21 namespace content { | 15 namespace content { |
| 22 | 16 |
| 23 // Holds parameters for constructing WebMediaPlayerImpl without having | 17 // Holds parameters for constructing WebMediaPlayerImpl without having |
| 24 // to plumb arguments through various abstraction layers. | 18 // to plumb arguments through various abstraction layers. |
| 25 class WebMediaPlayerParams { | 19 class WebMediaPlayerParams { |
| 26 public: | 20 public: |
| 27 // |message_loop_proxy| and |media_log| are the only required parameters; | 21 // Parameters may be null. |
| 28 // all others may be null. | |
| 29 WebMediaPlayerParams( | 22 WebMediaPlayerParams( |
| 30 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy, | |
| 31 const base::Callback<void(const base::Closure&)>& defer_load_cb, | 23 const base::Callback<void(const base::Closure&)>& defer_load_cb, |
| 32 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink, | 24 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink); |
| 33 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories, | |
| 34 const scoped_refptr<media::MediaLog>& media_log); | |
| 35 ~WebMediaPlayerParams(); | 25 ~WebMediaPlayerParams(); |
| 36 | 26 |
| 37 const scoped_refptr<base::MessageLoopProxy>& message_loop_proxy() const { | |
| 38 return message_loop_proxy_; | |
| 39 } | |
| 40 | |
| 41 base::Callback<void(const base::Closure&)> defer_load_cb() const { | 27 base::Callback<void(const base::Closure&)> defer_load_cb() const { |
| 42 return defer_load_cb_; | 28 return defer_load_cb_; |
| 43 } | 29 } |
| 44 | 30 |
| 45 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const { | 31 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const { |
| 46 return audio_renderer_sink_; | 32 return audio_renderer_sink_; |
| 47 } | 33 } |
| 48 | 34 |
| 49 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories() | |
| 50 const { | |
| 51 return gpu_factories_; | |
| 52 } | |
| 53 | |
| 54 const scoped_refptr<media::MediaLog>& media_log() const { | |
| 55 return media_log_; | |
| 56 } | |
| 57 | |
| 58 private: | 35 private: |
| 59 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; | |
| 60 base::Callback<void(const base::Closure&)> defer_load_cb_; | 36 base::Callback<void(const base::Closure&)> defer_load_cb_; |
| 61 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; | 37 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; |
| 62 scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories_; | |
| 63 scoped_refptr<media::MediaLog> media_log_; | |
| 64 | 38 |
| 65 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); | 39 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); |
| 66 }; | 40 }; |
| 67 | 41 |
| 68 } // namespace media | 42 } // namespace media |
| 69 | 43 |
| 70 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 44 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
| OLD | NEW |