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

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

Issue 445013002: media: Optimize HW Video to 2D Canvas copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to ToT Created 5 years, 11 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
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 12
12 namespace base { 13 namespace base {
13 class SingleThreadTaskRunner; 14 class SingleThreadTaskRunner;
14 } 15 }
15 16
16 namespace blink { 17 namespace blink {
17 class WebContentDecryptionModule; 18 class WebContentDecryptionModule;
18 class WebMediaPlayerClient; 19 class WebMediaPlayerClient;
19 } 20 }
20 21
21 namespace media { 22 namespace media {
22 23
23 class AudioRendererSink; 24 class AudioRendererSink;
24 class MediaLog; 25 class MediaLog;
25 26
26 // Holds parameters for constructing WebMediaPlayerImpl without having 27 // Holds parameters for constructing WebMediaPlayerImpl without having
27 // to plumb arguments through various abstraction layers. 28 // to plumb arguments through various abstraction layers.
28 class MEDIA_EXPORT WebMediaPlayerParams { 29 class MEDIA_EXPORT WebMediaPlayerParams {
29 public: 30 public:
30 typedef base::Callback<void(const base::Closure&)> DeferLoadCB; 31 typedef base::Callback<void(const base::Closure&)> DeferLoadCB;
32 typedef base::Callback<Context3D()> Context3DCB;
31 33
32 // |defer_load_cb|, |audio_renderer_sink|, and |compositor_task_runner| may be 34 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and
33 // null. 35 // |context_3d_cb| may be null.
34 WebMediaPlayerParams( 36 WebMediaPlayerParams(
35 const DeferLoadCB& defer_load_cb, 37 const DeferLoadCB& defer_load_cb,
36 const scoped_refptr<AudioRendererSink>& audio_renderer_sink, 38 const scoped_refptr<AudioRendererSink>& audio_renderer_sink,
37 const scoped_refptr<MediaLog>& media_log, 39 const scoped_refptr<MediaLog>& media_log,
38 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, 40 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner,
39 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, 41 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner,
42 const Context3DCB& context_3d,
40 blink::WebContentDecryptionModule* initial_cdm); 43 blink::WebContentDecryptionModule* initial_cdm);
41 44
42 ~WebMediaPlayerParams(); 45 ~WebMediaPlayerParams();
43 46
44 base::Callback<void(const base::Closure&)> defer_load_cb() const { 47 DeferLoadCB defer_load_cb() const { return defer_load_cb_; }
45 return defer_load_cb_;
46 }
47 48
48 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const { 49 const scoped_refptr<AudioRendererSink>& audio_renderer_sink() const {
49 return audio_renderer_sink_; 50 return audio_renderer_sink_;
50 } 51 }
51 52
52 const scoped_refptr<MediaLog>& media_log() const { 53 const scoped_refptr<MediaLog>& media_log() const {
53 return media_log_; 54 return media_log_;
54 } 55 }
55 56
56 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner() const { 57 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner() const {
57 return media_task_runner_; 58 return media_task_runner_;
58 } 59 }
59 60
60 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner() 61 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner()
61 const { 62 const {
62 return compositor_task_runner_; 63 return compositor_task_runner_;
63 } 64 }
64 65
65 blink::WebContentDecryptionModule* initial_cdm() const { 66 blink::WebContentDecryptionModule* initial_cdm() const {
66 return initial_cdm_; 67 return initial_cdm_;
67 } 68 }
68 69
70 Context3DCB context_3d_cb() const { return context_3d_cb_; }
71
69 private: 72 private:
70 base::Callback<void(const base::Closure&)> defer_load_cb_; 73 DeferLoadCB defer_load_cb_;
71 scoped_refptr<AudioRendererSink> audio_renderer_sink_; 74 scoped_refptr<AudioRendererSink> audio_renderer_sink_;
72 scoped_refptr<MediaLog> media_log_; 75 scoped_refptr<MediaLog> media_log_;
73 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; 76 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
74 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; 77 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
78 Context3DCB context_3d_cb_;
75 blink::WebContentDecryptionModule* initial_cdm_; 79 blink::WebContentDecryptionModule* initial_cdm_;
76 80
77 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); 81 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams);
78 }; 82 };
79 83
80 } // namespace media 84 } // namespace media
81 85
82 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ 86 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698