Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Side by Side Diff: media/blink/webmediaplayer_params.h

Issue 887873003: media: Add DefaultMediaPermission. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/blink/webmediaplayer_params.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 } 15 }
16 16
17 namespace blink { 17 namespace blink {
18 class WebContentDecryptionModule; 18 class WebContentDecryptionModule;
19 class WebMediaPlayerClient; 19 class WebMediaPlayerClient;
20 } 20 }
21 21
22 namespace media { 22 namespace media {
23 23
24 class AudioRendererSink; 24 class AudioRendererSink;
25 class MediaLog; 25 class MediaLog;
26 class MediaPermission;
26 27
27 // Holds parameters for constructing WebMediaPlayerImpl without having 28 // Holds parameters for constructing WebMediaPlayerImpl without having
28 // to plumb arguments through various abstraction layers. 29 // to plumb arguments through various abstraction layers.
29 class MEDIA_EXPORT WebMediaPlayerParams { 30 class MEDIA_EXPORT WebMediaPlayerParams {
30 public: 31 public:
31 typedef base::Callback<void(const base::Closure&)> DeferLoadCB; 32 typedef base::Callback<void(const base::Closure&)> DeferLoadCB;
32 typedef base::Callback<Context3D()> Context3DCB; 33 typedef base::Callback<Context3D()> Context3DCB;
33 34
34 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and 35 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and
35 // |context_3d_cb| may be null. 36 // |context_3d_cb| may be null.
36 WebMediaPlayerParams( 37 WebMediaPlayerParams(
37 const DeferLoadCB& defer_load_cb, 38 const DeferLoadCB& defer_load_cb,
38 const scoped_refptr<AudioRendererSink>& audio_renderer_sink, 39 const scoped_refptr<AudioRendererSink>& audio_renderer_sink,
39 const scoped_refptr<MediaLog>& media_log, 40 const scoped_refptr<MediaLog>& media_log,
40 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, 41 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
41 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, 42 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
42 const Context3DCB& context_3d, 43 const Context3DCB& context_3d,
44 MediaPermission* media_permission,
43 blink::WebContentDecryptionModule* initial_cdm); 45 blink::WebContentDecryptionModule* initial_cdm);
44 46
45 ~WebMediaPlayerParams(); 47 ~WebMediaPlayerParams();
46 48
47 DeferLoadCB defer_load_cb() const { return defer_load_cb_; } 49 DeferLoadCB defer_load_cb() const { return defer_load_cb_; }
48 50
49 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const { 51 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const {
50 return audio_renderer_sink_; 52 return audio_renderer_sink_;
51 } 53 }
52 54
53 const scoped_refptr<MediaLog>& media_log() const { 55 const scoped_refptr<MediaLog>& media_log() const {
54 return media_log_; 56 return media_log_;
55 } 57 }
56 58
57 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner() const { 59 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner() const {
58 return media_task_runner_; 60 return media_task_runner_;
59 } 61 }
60 62
61 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner() 63 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner()
62 const { 64 const {
63 return compositor_task_runner_; 65 return compositor_task_runner_;
64 } 66 }
65 67
68 Context3DCB context_3d_cb() const { return context_3d_cb_; }
69
70 MediaPermission* media_permission() const { return media_permission_; }
71
66 blink::WebContentDecryptionModule* initial_cdm() const { 72 blink::WebContentDecryptionModule* initial_cdm() const {
67 return initial_cdm_; 73 return initial_cdm_;
68 } 74 }
69 75
70 Context3DCB context_3d_cb() const { return context_3d_cb_; }
71 76
72 private: 77 private:
73 DeferLoadCB defer_load_cb_; 78 DeferLoadCB defer_load_cb_;
74 scoped_refptr<AudioRendererSink> audio_renderer_sink_; 79 scoped_refptr<AudioRendererSink> audio_renderer_sink_;
75 scoped_refptr<MediaLog> media_log_; 80 scoped_refptr<MediaLog> media_log_;
76 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; 81 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
77 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; 82 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
78 Context3DCB context_3d_cb_; 83 Context3DCB context_3d_cb_;
84
85 // TODO(xhwang): Remove after prefixed EME API support is removed.
86 MediaPermission* media_permission_;
79 blink::WebContentDecryptionModule* initial_cdm_; 87 blink::WebContentDecryptionModule* initial_cdm_;
80 88
81 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); 89 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams);
82 }; 90 };
83 91
84 } // namespace media 92 } // namespace media
85 93
86 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ 94 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/blink/webmediaplayer_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698