Delete chrome.mediaGalleriesPrivate because the functionality unique to it has since...
[chromium-blink-merge.git] / media / blink / webmediaplayer_params.h
blob6893ed6b86237569dec5f55e98419e80e6d2e591
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"
13 namespace base {
14 class SingleThreadTaskRunner;
17 namespace blink {
18 class WebContentDecryptionModule;
19 class WebMediaPlayerClient;
22 namespace media {
24 class AudioRendererSink;
25 class MediaLog;
27 // Holds parameters for constructing WebMediaPlayerImpl without having
28 // to plumb arguments through various abstraction layers.
29 class MEDIA_EXPORT WebMediaPlayerParams {
30 public:
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.
36 WebMediaPlayerParams(
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 {
54 return media_log_;
57 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner() const {
58 return media_task_runner_;
61 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner()
62 const {
63 return compositor_task_runner_;
66 blink::WebContentDecryptionModule* initial_cdm() const {
67 return initial_cdm_;
70 Context3DCB context_3d_cb() const { return context_3d_cb_; }
72 private:
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);
84 } // namespace media
86 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_