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
;
18 class WebContentDecryptionModule
;
19 class WebMediaPlayerClient
;
24 class AudioRendererSink
;
26 class MediaPermission
;
28 // Holds parameters for constructing WebMediaPlayerImpl without having
29 // to plumb arguments through various abstraction layers.
30 class MEDIA_EXPORT WebMediaPlayerParams
{
32 typedef base::Callback
<void(const base::Closure
&)> DeferLoadCB
;
33 typedef base::Callback
<Context3D()> Context3DCB
;
35 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and
36 // |context_3d_cb| may be null.
38 const DeferLoadCB
& defer_load_cb
,
39 const scoped_refptr
<AudioRendererSink
>& audio_renderer_sink
,
40 const scoped_refptr
<MediaLog
>& media_log
,
41 const scoped_refptr
<base::SingleThreadTaskRunner
>& media_task_runner
,
42 const scoped_refptr
<base::SingleThreadTaskRunner
>& compositor_task_runner
,
43 const Context3DCB
& context_3d
,
44 MediaPermission
* media_permission
,
45 blink::WebContentDecryptionModule
* initial_cdm
);
47 ~WebMediaPlayerParams();
49 DeferLoadCB
defer_load_cb() const { return defer_load_cb_
; }
51 const scoped_refptr
<AudioRendererSink
>& audio_renderer_sink() const {
52 return audio_renderer_sink_
;
55 const scoped_refptr
<MediaLog
>& media_log() const {
59 const scoped_refptr
<base::SingleThreadTaskRunner
>& media_task_runner() const {
60 return media_task_runner_
;
63 const scoped_refptr
<base::SingleThreadTaskRunner
>& compositor_task_runner()
65 return compositor_task_runner_
;
68 Context3DCB
context_3d_cb() const { return context_3d_cb_
; }
70 MediaPermission
* media_permission() const { return media_permission_
; }
72 blink::WebContentDecryptionModule
* initial_cdm() const {
78 DeferLoadCB defer_load_cb_
;
79 scoped_refptr
<AudioRendererSink
> audio_renderer_sink_
;
80 scoped_refptr
<MediaLog
> media_log_
;
81 scoped_refptr
<base::SingleThreadTaskRunner
> media_task_runner_
;
82 scoped_refptr
<base::SingleThreadTaskRunner
> compositor_task_runner_
;
83 Context3DCB context_3d_cb_
;
85 // TODO(xhwang): Remove after prefixed EME API support is removed.
86 MediaPermission
* media_permission_
;
87 blink::WebContentDecryptionModule
* initial_cdm_
;
89 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams
);
94 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_