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
3 // found in the LICENSE file.
5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "media/base/media_export.h"
11 #include "media/filters/context_3d.h"
14 class SingleThreadTaskRunner
;
19 class WebContentDecryptionModule
;
20 class WebMediaPlayerClient
;
25 class AudioRendererSink
;
27 class MediaPermission
;
29 // Holds parameters for constructing WebMediaPlayerImpl without having
30 // to plumb arguments through various abstraction layers.
31 class MEDIA_EXPORT WebMediaPlayerParams
{
33 typedef base::Callback
<void(const base::Closure
&)> DeferLoadCB
;
34 typedef base::Callback
<Context3D()> Context3DCB
;
36 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and
37 // |context_3d_cb| may be null.
39 const DeferLoadCB
& defer_load_cb
,
40 const scoped_refptr
<AudioRendererSink
>& audio_renderer_sink
,
41 const scoped_refptr
<MediaLog
>& media_log
,
42 const scoped_refptr
<base::SingleThreadTaskRunner
>& media_task_runner
,
43 const scoped_refptr
<base::TaskRunner
>& worker_task_runner
,
44 const scoped_refptr
<base::SingleThreadTaskRunner
>& compositor_task_runner
,
45 const Context3DCB
& context_3d
,
46 MediaPermission
* media_permission
,
47 blink::WebContentDecryptionModule
* initial_cdm
);
49 ~WebMediaPlayerParams();
51 DeferLoadCB
defer_load_cb() const { return defer_load_cb_
; }
53 const scoped_refptr
<AudioRendererSink
>& audio_renderer_sink() const {
54 return audio_renderer_sink_
;
57 const scoped_refptr
<MediaLog
>& media_log() const {
61 const scoped_refptr
<base::SingleThreadTaskRunner
>& media_task_runner() const {
62 return media_task_runner_
;
65 const scoped_refptr
<base::TaskRunner
> worker_task_runner() const {
66 return worker_task_runner_
;
69 const scoped_refptr
<base::SingleThreadTaskRunner
>& compositor_task_runner()
71 return compositor_task_runner_
;
74 Context3DCB
context_3d_cb() const { return context_3d_cb_
; }
76 MediaPermission
* media_permission() const { return media_permission_
; }
78 blink::WebContentDecryptionModule
* initial_cdm() const {
84 DeferLoadCB defer_load_cb_
;
85 scoped_refptr
<AudioRendererSink
> audio_renderer_sink_
;
86 scoped_refptr
<MediaLog
> media_log_
;
87 scoped_refptr
<base::SingleThreadTaskRunner
> media_task_runner_
;
88 scoped_refptr
<base::TaskRunner
> worker_task_runner_
;
89 scoped_refptr
<base::SingleThreadTaskRunner
> compositor_task_runner_
;
90 Context3DCB context_3d_cb_
;
92 // TODO(xhwang): Remove after prefixed EME API support is removed.
93 MediaPermission
* media_permission_
;
94 blink::WebContentDecryptionModule
* initial_cdm_
;
96 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams
);
101 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_