Chromium Code Reviews| 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 #include "content/renderer/media/crypto/encrypted_media_player_support.h" | |
| 11 | |
| 12 namespace base { | |
| 13 class SingleThreadTaskRunner; | |
| 14 } | |
| 10 | 15 |
| 11 namespace media { | 16 namespace media { |
| 17 class AudioHardwareConfig; | |
| 12 class AudioRendererSink; | 18 class AudioRendererSink; |
| 19 class GpuVideoAcceleratorFactories; | |
| 20 class MediaLog; | |
| 13 } | 21 } |
| 14 | 22 |
| 15 namespace content { | 23 namespace content { |
| 16 | 24 |
| 17 // Holds parameters for constructing WebMediaPlayerImpl without having | 25 // Holds parameters for constructing WebMediaPlayerImpl without having |
| 18 // to plumb arguments through various abstraction layers. | 26 // to plumb arguments through various abstraction layers. |
| 19 class WebMediaPlayerParams { | 27 class WebMediaPlayerParams { |
| 20 public: | 28 public: |
| 21 // Parameters may be null. | 29 // Parameters may be null. |
|
scherkus (not reviewing)
2014/08/28 18:36:12
is this still true?
acolwell GONE FROM CHROMIUM
2014/08/28 19:07:28
No. Updated comment to indicate which ones can be
| |
| 22 WebMediaPlayerParams( | 30 WebMediaPlayerParams( |
| 23 const base::Callback<void(const base::Closure&)>& defer_load_cb, | 31 const base::Callback<void(const base::Closure&)>& defer_load_cb, |
| 24 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink); | 32 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink, |
| 33 const media::AudioHardwareConfig* audio_hardware_config, | |
| 34 const scoped_refptr<media::MediaLog>& media_log, | |
| 35 const scoped_refptr<media::GpuVideoAcceleratorFactories>& gpu_factories, | |
| 36 const scoped_refptr<base::SingleThreadTaskRunner>& | |
| 37 media_task_runner, | |
| 38 const scoped_refptr<base::SingleThreadTaskRunner>& | |
| 39 compositor_task_runner, | |
| 40 scoped_ptr<EncryptedMediaPlayerSupport> encrypted_media_player_support); | |
| 25 ~WebMediaPlayerParams(); | 41 ~WebMediaPlayerParams(); |
| 26 | 42 |
| 27 base::Callback<void(const base::Closure&)> defer_load_cb() const { | 43 base::Callback<void(const base::Closure&)> defer_load_cb() const { |
| 28 return defer_load_cb_; | 44 return defer_load_cb_; |
| 29 } | 45 } |
| 30 | 46 |
| 31 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const { | 47 const scoped_refptr<media::AudioRendererSink>& audio_renderer_sink() const { |
| 32 return audio_renderer_sink_; | 48 return audio_renderer_sink_; |
| 33 } | 49 } |
| 34 | 50 |
| 51 const media::AudioHardwareConfig* audio_hardware_config() const { | |
| 52 return audio_hardware_config_; | |
| 53 } | |
| 54 | |
| 55 const scoped_refptr<media::MediaLog>& media_log() const { | |
| 56 return media_log_; | |
| 57 } | |
| 58 | |
| 59 const scoped_refptr<media::GpuVideoAcceleratorFactories>& | |
| 60 gpu_factories() const { | |
| 61 return gpu_factories_; | |
| 62 } | |
| 63 | |
| 64 const scoped_refptr<base::SingleThreadTaskRunner>& | |
| 65 media_task_runner() const { | |
| 66 return media_task_runner_; | |
| 67 } | |
| 68 | |
| 69 const scoped_refptr<base::SingleThreadTaskRunner>& | |
| 70 compositor_task_runner() const { | |
| 71 return compositor_task_runner_; | |
| 72 } | |
| 73 | |
| 74 scoped_ptr<EncryptedMediaPlayerSupport> encrypted_media_player_support() { | |
| 75 return encrypted_media_player_support_.Pass(); | |
|
scherkus (not reviewing)
2014/08/28 18:36:12
Having this be the only method that actually passe
acolwell GONE FROM CHROMIUM
2014/08/28 19:07:28
Yeah. Not super happy about this.
scherkus (not reviewing)
2014/08/28 19:12:15
Yeah ... I'm fine leaving this roughly as they are
| |
| 76 } | |
| 77 | |
| 35 private: | 78 private: |
| 36 base::Callback<void(const base::Closure&)> defer_load_cb_; | 79 base::Callback<void(const base::Closure&)> defer_load_cb_; |
| 37 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; | 80 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_; |
| 81 const media::AudioHardwareConfig* audio_hardware_config_; | |
| 82 scoped_refptr<media::MediaLog> media_log_; | |
| 83 scoped_refptr<media::GpuVideoAcceleratorFactories> gpu_factories_; | |
| 84 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; | |
| 85 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; | |
| 86 scoped_ptr<EncryptedMediaPlayerSupport> encrypted_media_player_support_; | |
| 38 | 87 |
| 39 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); | 88 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); |
| 40 }; | 89 }; |
| 41 | 90 |
| 42 } // namespace content | 91 } // namespace content |
| 43 | 92 |
| 44 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ | 93 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_PARAMS_H_ |
| OLD | NEW |