OLD | NEW |
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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 typedef base::Callback<void(const base::Closure&)> DeferLoadCB; | 37 typedef base::Callback<void(const base::Closure&)> DeferLoadCB; |
38 typedef base::Callback<Context3D()> Context3DCB; | 38 typedef base::Callback<Context3D()> Context3DCB; |
39 | 39 |
40 // Callback to tell V8 about the amount of memory used by the WebMediaPlayer | 40 // Callback to tell V8 about the amount of memory used by the WebMediaPlayer |
41 // instance. The input parameter is the delta in bytes since the last call to | 41 // instance. The input parameter is the delta in bytes since the last call to |
42 // AdjustAllocatedMemoryCB and the return value is the total number of bytes | 42 // AdjustAllocatedMemoryCB and the return value is the total number of bytes |
43 // used by objects external to V8. Note: this value includes things that are | 43 // used by objects external to V8. Note: this value includes things that are |
44 // not the WebMediaPlayer! | 44 // not the WebMediaPlayer! |
45 typedef base::Callback<int64_t(int64_t)> AdjustAllocatedMemoryCB; | 45 typedef base::Callback<int64_t(int64_t)> AdjustAllocatedMemoryCB; |
46 | 46 |
| 47 // Callback to tell WebMediaPlayerImpl whether remoting CdmFactory is used. |
| 48 using IsRemoteCdmCB = base::Callback<bool()>; |
| 49 |
47 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and | 50 // |defer_load_cb|, |audio_renderer_sink|, |compositor_task_runner|, and |
48 // |context_3d_cb| may be null. | 51 // |context_3d_cb| may be null. |
49 WebMediaPlayerParams( | 52 WebMediaPlayerParams( |
50 const DeferLoadCB& defer_load_cb, | 53 const DeferLoadCB& defer_load_cb, |
51 const scoped_refptr<SwitchableAudioRendererSink>& audio_renderer_sink, | 54 const scoped_refptr<SwitchableAudioRendererSink>& audio_renderer_sink, |
52 const scoped_refptr<MediaLog>& media_log, | 55 const scoped_refptr<MediaLog>& media_log, |
53 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, | 56 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, |
54 const scoped_refptr<base::TaskRunner>& worker_task_runner, | 57 const scoped_refptr<base::TaskRunner>& worker_task_runner, |
55 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, | 58 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, |
56 const Context3DCB& context_3d, | 59 const Context3DCB& context_3d, |
57 const AdjustAllocatedMemoryCB& adjust_allocated_memory_cb, | 60 const AdjustAllocatedMemoryCB& adjust_allocated_memory_cb, |
| 61 const IsRemoteCdmCB& is_remote_cdm_cb, |
58 blink::WebContentDecryptionModule* initial_cdm, | 62 blink::WebContentDecryptionModule* initial_cdm, |
59 SurfaceManager* surface_manager, | 63 SurfaceManager* surface_manager, |
60 blink::WebMediaSession* media_session); | 64 blink::WebMediaSession* media_session); |
61 | 65 |
62 ~WebMediaPlayerParams(); | 66 ~WebMediaPlayerParams(); |
63 | 67 |
64 DeferLoadCB defer_load_cb() const { return defer_load_cb_; } | 68 DeferLoadCB defer_load_cb() const { return defer_load_cb_; } |
65 | 69 |
66 const scoped_refptr<SwitchableAudioRendererSink>& audio_renderer_sink() | 70 const scoped_refptr<SwitchableAudioRendererSink>& audio_renderer_sink() |
67 const { | 71 const { |
(...skipping 24 matching lines...) Expand all Loading... |
92 } | 96 } |
93 | 97 |
94 AdjustAllocatedMemoryCB adjust_allocated_memory_cb() const { | 98 AdjustAllocatedMemoryCB adjust_allocated_memory_cb() const { |
95 return adjust_allocated_memory_cb_; | 99 return adjust_allocated_memory_cb_; |
96 } | 100 } |
97 | 101 |
98 SurfaceManager* surface_manager() const { return surface_manager_; } | 102 SurfaceManager* surface_manager() const { return surface_manager_; } |
99 | 103 |
100 const blink::WebMediaSession* media_session() const { return media_session_; } | 104 const blink::WebMediaSession* media_session() const { return media_session_; } |
101 | 105 |
| 106 IsRemoteCdmCB is_remote_cdm_cb() const { return is_remote_cdm_cb_; } |
| 107 |
102 private: | 108 private: |
103 DeferLoadCB defer_load_cb_; | 109 DeferLoadCB defer_load_cb_; |
104 scoped_refptr<SwitchableAudioRendererSink> audio_renderer_sink_; | 110 scoped_refptr<SwitchableAudioRendererSink> audio_renderer_sink_; |
105 scoped_refptr<MediaLog> media_log_; | 111 scoped_refptr<MediaLog> media_log_; |
106 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; | 112 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; |
107 scoped_refptr<base::TaskRunner> worker_task_runner_; | 113 scoped_refptr<base::TaskRunner> worker_task_runner_; |
108 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; | 114 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; |
109 Context3DCB context_3d_cb_; | 115 Context3DCB context_3d_cb_; |
110 AdjustAllocatedMemoryCB adjust_allocated_memory_cb_; | 116 AdjustAllocatedMemoryCB adjust_allocated_memory_cb_; |
111 | 117 |
112 blink::WebContentDecryptionModule* initial_cdm_; | 118 blink::WebContentDecryptionModule* initial_cdm_; |
113 SurfaceManager* surface_manager_; | 119 SurfaceManager* surface_manager_; |
114 | 120 |
115 blink::WebMediaSession* media_session_; | 121 blink::WebMediaSession* media_session_; |
116 | 122 |
| 123 IsRemoteCdmCB is_remote_cdm_cb_; |
| 124 |
117 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); | 125 DISALLOW_IMPLICIT_CONSTRUCTORS(WebMediaPlayerParams); |
118 }; | 126 }; |
119 | 127 |
120 } // namespace media | 128 } // namespace media |
121 | 129 |
122 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ | 130 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_PARAMS_H_ |
OLD | NEW |