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