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

Side by Side Diff: content/renderer/media/webmediaplayer_ms_compositor.cc

Issue 2472273002: Move passing of WebRTC rendering frames from main thread to compositor thread (Closed)
Patch Set: wez@ nits. Created 4 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "content/renderer/media/webmediaplayer_ms_compositor.h" 5 #include "content/renderer/media/webmediaplayer_ms_compositor.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 196 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
197 if (video_frame_provider_client_) 197 if (video_frame_provider_client_)
198 video_frame_provider_client_->StopUsingProvider(); 198 video_frame_provider_client_->StopUsingProvider();
199 199
200 video_frame_provider_client_ = client; 200 video_frame_provider_client_ = client;
201 if (video_frame_provider_client_ && !stopped_) 201 if (video_frame_provider_client_ && !stopped_)
202 video_frame_provider_client_->StartRendering(); 202 video_frame_provider_client_->StartRendering();
203 } 203 }
204 204
205 void WebMediaPlayerMSCompositor::EnqueueFrame( 205 void WebMediaPlayerMSCompositor::EnqueueFrame(
206 const scoped_refptr<media::VideoFrame>& frame) { 206 scoped_refptr<media::VideoFrame> frame) {
207 DCHECK(thread_checker_.CalledOnValidThread()); 207 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
208 base::AutoLock auto_lock(current_frame_lock_); 208 base::AutoLock auto_lock(current_frame_lock_);
209 ++total_frame_count_; 209 ++total_frame_count_;
210 210
211 // With algorithm off, just let |current_frame_| hold the incoming |frame|. 211 // With algorithm off, just let |current_frame_| hold the incoming |frame|.
212 if (!rendering_frame_buffer_) { 212 if (!rendering_frame_buffer_) {
213 SetCurrentFrame(frame); 213 SetCurrentFrame(frame);
214 return; 214 return;
215 } 215 }
216 216
217 // This is a signal frame saying that the stream is stopped. 217 // This is a signal frame saying that the stream is stopped.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 438 }
439 439
440 if (!rendering_frame_buffer_) { 440 if (!rendering_frame_buffer_) {
441 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( 441 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm(
442 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, 442 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks,
443 base::Unretained(this)))); 443 base::Unretained(this))));
444 } 444 }
445 } 445 }
446 446
447 } // namespace content 447 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698