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

Side by Side Diff: content/renderer/media/webmediaplayer_ms.h

Issue 2529263004: Move passing of WebRTC rendering frames to IO thread (Closed)
Patch Set: qiangchen@ comment Created 4 years 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 CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_
6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ 6 #define CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 public NON_EXPORTED_BASE(base::SupportsWeakPtr<WebMediaPlayerMS>) { 67 public NON_EXPORTED_BASE(base::SupportsWeakPtr<WebMediaPlayerMS>) {
68 public: 68 public:
69 // Construct a WebMediaPlayerMS with reference to the client, and 69 // Construct a WebMediaPlayerMS with reference to the client, and
70 // a MediaStreamClient which provides MediaStreamVideoRenderer. 70 // a MediaStreamClient which provides MediaStreamVideoRenderer.
71 WebMediaPlayerMS( 71 WebMediaPlayerMS(
72 blink::WebFrame* frame, 72 blink::WebFrame* frame,
73 blink::WebMediaPlayerClient* client, 73 blink::WebMediaPlayerClient* client,
74 base::WeakPtr<media::WebMediaPlayerDelegate> delegate, 74 base::WeakPtr<media::WebMediaPlayerDelegate> delegate,
75 media::MediaLog* media_log, 75 media::MediaLog* media_log,
76 std::unique_ptr<MediaStreamRendererFactory> factory, 76 std::unique_ptr<MediaStreamRendererFactory> factory,
77 const scoped_refptr<base::SingleThreadTaskRunner>& compositor_task_runner, 77 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_,
78 const scoped_refptr<base::SingleThreadTaskRunner>& media_task_runner, 78 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner,
79 const scoped_refptr<base::TaskRunner>& worker_task_runner, 79 scoped_refptr<base::SingleThreadTaskRunner> media_task_runner,
80 scoped_refptr<base::TaskRunner> worker_task_runner,
80 media::GpuVideoAcceleratorFactories* gpu_factories, 81 media::GpuVideoAcceleratorFactories* gpu_factories,
81 const blink::WebString& sink_id, 82 const blink::WebString& sink_id,
82 const blink::WebSecurityOrigin& security_origin); 83 const blink::WebSecurityOrigin& security_origin);
83 84
84 ~WebMediaPlayerMS() override; 85 ~WebMediaPlayerMS() override;
85 86
86 void load(LoadType load_type, 87 void load(LoadType load_type,
87 const blink::WebMediaPlayerSource& source, 88 const blink::WebMediaPlayerSource& source,
88 CORSMode cors_mode) override; 89 CORSMode cors_mode) override;
89 90
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 void OnPause() override; 150 void OnPause() override;
150 void OnVolumeMultiplierUpdate(double multiplier) override; 151 void OnVolumeMultiplierUpdate(double multiplier) override;
151 152
152 bool copyVideoTextureToPlatformTexture(gpu::gles2::GLES2Interface* gl, 153 bool copyVideoTextureToPlatformTexture(gpu::gles2::GLES2Interface* gl,
153 unsigned int texture, 154 unsigned int texture,
154 unsigned int internal_format, 155 unsigned int internal_format,
155 unsigned int type, 156 unsigned int type,
156 bool premultiply_alpha, 157 bool premultiply_alpha,
157 bool flip_y) override; 158 bool flip_y) override;
158 159
159 bool texImageImpl(TexImageFunctionID functionID, 160 bool texImageImpl(TexImageFunctionID functionID,
qiangchen 2016/12/07 17:44:13 I did not see where this new function gets used.
emircan 2016/12/07 18:10:04 It is added by rebase, not related to my CL.
160 unsigned target, 161 unsigned target,
161 gpu::gles2::GLES2Interface* gl, 162 gpu::gles2::GLES2Interface* gl,
162 int level, 163 int level,
163 int internalformat, 164 int internalformat,
164 unsigned format, 165 unsigned format,
165 unsigned type, 166 unsigned type,
166 int xoffset, 167 int xoffset,
167 int yoffset, 168 int yoffset,
168 int zoffset, 169 int zoffset,
169 bool flip_y, 170 bool flip_y,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_; // Weak 220 scoped_refptr<MediaStreamAudioRenderer> audio_renderer_; // Weak
220 media::SkCanvasVideoRenderer video_renderer_; 221 media::SkCanvasVideoRenderer video_renderer_;
221 222
222 bool paused_; 223 bool paused_;
223 media::VideoRotation video_rotation_; 224 media::VideoRotation video_rotation_;
224 225
225 scoped_refptr<media::MediaLog> media_log_; 226 scoped_refptr<media::MediaLog> media_log_;
226 227
227 std::unique_ptr<MediaStreamRendererFactory> renderer_factory_; 228 std::unique_ptr<MediaStreamRendererFactory> renderer_factory_;
228 229
230 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
231 const scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
229 const scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_; 232 const scoped_refptr<base::SingleThreadTaskRunner> media_task_runner_;
230 const scoped_refptr<base::TaskRunner> worker_task_runner_; 233 const scoped_refptr<base::TaskRunner> worker_task_runner_;
231 media::GpuVideoAcceleratorFactories* gpu_factories_; 234 media::GpuVideoAcceleratorFactories* gpu_factories_;
232 235
233 // Used for DCHECKs to ensure methods calls executed in the correct thread. 236 // Used for DCHECKs to ensure methods calls executed in the correct thread.
234 base::ThreadChecker thread_checker_; 237 base::ThreadChecker thread_checker_;
235 238
236 // WebMediaPlayerMS owns |compositor_| and destroys it on 239 scoped_refptr<WebMediaPlayerMSCompositor> compositor_;
237 // |compositor_task_runner_|.
238 std::unique_ptr<WebMediaPlayerMSCompositor> compositor_;
239
240 const scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
241 240
242 const std::string initial_audio_output_device_id_; 241 const std::string initial_audio_output_device_id_;
243 const url::Origin initial_security_origin_; 242 const url::Origin initial_security_origin_;
244 243
245 // The last volume received by setVolume() and the last volume multiplier from 244 // The last volume received by setVolume() and the last volume multiplier from
246 // OnVolumeMultiplierUpdate(). The multiplier is typical 1.0, but may be less 245 // OnVolumeMultiplierUpdate(). The multiplier is typical 1.0, but may be less
247 // if the WebMediaPlayerDelegate has requested a volume reduction (ducking) 246 // if the WebMediaPlayerDelegate has requested a volume reduction (ducking)
248 // for a transient sound. Playout volume is derived by volume * multiplier. 247 // for a transient sound. Playout volume is derived by volume * multiplier.
249 double volume_; 248 double volume_;
250 double volume_multiplier_; 249 double volume_multiplier_;
251 250
252 // True if playback should be started upon the next call to OnShown(). Only 251 // True if playback should be started upon the next call to OnShown(). Only
253 // used on Android. 252 // used on Android.
254 bool should_play_upon_shown_; 253 bool should_play_upon_shown_;
255 254
256 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS); 255 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerMS);
257 }; 256 };
258 257
259 } // namespace content 258 } // namespace content
260 259
261 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_ 260 #endif // CONTENT_RENDERER_MEDIA_WEBMEDIAPLAYER_MS_H_
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_video_renderer_sink_unittest.cc ('k') | content/renderer/media/webmediaplayer_ms.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698