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
;
27 // Holds parameters for constructing WebMediaPlayerImpl without having
28 // to plumb arguments through various abstraction layers.
29 class MEDIA_EXPORT WebMediaPlayerParams
{
31 typedef base::Callback
<void(const base::Closure
&)> DeferLoadCB
;
32 typedef base::Callback
<Context3D()> Context3DCB
;
34 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and
35 // |context_3d_cb| may be null.
37 const DeferLoadCB
& defer_load_cb
,
38 const scoped_refptr
<AudioRendererSink
>& audio_renderer_sink
,
39 const scoped_refptr
<MediaLog
>& media_log
,
40 const scoped_refptr
<base::SingleThreadTaskRunner
>& media_task_runner
,
41 const scoped_refptr
<base::SingleThreadTaskRunner
>& compositor_task_runner
,
42 const Context3DCB
& context_3d
,
43 blink::WebContentDecryptionModule
* initial_cdm
);
45 ~WebMediaPlayerParams();
47 DeferLoadCB
defer_load_cb() const { return defer_load_cb_
; }
49 const scoped_refptr
<AudioRendererSink
>& audio_renderer_sink() const {
50 return audio_renderer_sink_
;
53 const scoped_refptr
<MediaLog
>& media_log() const {
57 const scoped_refptr
<base::SingleThreadTaskRunner
>& media_task_runner() const {
58 return media_task_runner_
;
61 const scoped_refptr
<base::SingleThreadTaskRunner
>& compositor_task_runner()
63 return compositor_task_runner_
;
66 blink::WebContentDecryptionModule
* initial_cdm() const {
70 Context3DCB
context_3d_cb() const { return context_3d_cb_
; }
73 DeferLoadCB defer_load_cb_
;
74 scoped_refptr
<AudioRendererSink
> audio_renderer_sink_
;
75 scoped_refptr
<MediaLog
> media_log_
;
76 scoped_refptr
<base::SingleThreadTaskRunner
> media_task_runner_
;
77 scoped_refptr
<base::SingleThreadTaskRunner
> compositor_task_runner_
;
78 Context3DCB context_3d_cb_
;
79 blink::WebContentDecryptionModule
* initial_cdm_
;
81 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams
);
86 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_