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

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

Issue 1930003002: Bug Fix: Rendering stuck due to thread issue of WebMediaPlayerMSCompositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Function Rename Created 4 years, 7 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 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 } 280 }
281 281
282 bool WebMediaPlayerMSCompositor::HasCurrentFrame() { 282 bool WebMediaPlayerMSCompositor::HasCurrentFrame() {
283 base::AutoLock auto_lock(current_frame_lock_); 283 base::AutoLock auto_lock(current_frame_lock_);
284 return current_frame_.get() != nullptr; 284 return current_frame_.get() != nullptr;
285 } 285 }
286 286
287 scoped_refptr<media::VideoFrame> WebMediaPlayerMSCompositor::GetCurrentFrame() { 287 scoped_refptr<media::VideoFrame> WebMediaPlayerMSCompositor::GetCurrentFrame() {
288 DVLOG(3) << __FUNCTION__; 288 DVLOG(3) << __FUNCTION__;
289 base::AutoLock auto_lock(current_frame_lock_); 289 base::AutoLock auto_lock(current_frame_lock_);
290 current_frame_used_by_compositor_ = true;
291 return current_frame_;
292 }
293
294 void WebMediaPlayerMSCompositor::PutCurrentFrame() {
295 DVLOG(3) << __FUNCTION__;
296 }
297
298 scoped_refptr<media::VideoFrame>
299 WebMediaPlayerMSCompositor::GetCurrentFrameWithoutUpdatingStatistics() {
300 DVLOG(3) << __FUNCTION__;
301 base::AutoLock auto_lock(current_frame_lock_);
290 return current_frame_; 302 return current_frame_;
291 } 303 }
292 304
293 void WebMediaPlayerMSCompositor::PutCurrentFrame() {
294 DVLOG(3) << __FUNCTION__;
295 base::AutoLock auto_lock(current_frame_lock_);
296 current_frame_used_by_compositor_ = true;
297 }
298
299 void WebMediaPlayerMSCompositor::StartRendering() { 305 void WebMediaPlayerMSCompositor::StartRendering() {
300 DCHECK(thread_checker_.CalledOnValidThread()); 306 DCHECK(thread_checker_.CalledOnValidThread());
301 compositor_task_runner_->PostTask( 307 compositor_task_runner_->PostTask(
302 FROM_HERE, base::Bind(&WebMediaPlayerMSCompositor::StartRenderingInternal, 308 FROM_HERE, base::Bind(&WebMediaPlayerMSCompositor::StartRenderingInternal,
303 weak_ptr_factory_.GetWeakPtr())); 309 weak_ptr_factory_.GetWeakPtr()));
304 } 310 }
305 311
306 void WebMediaPlayerMSCompositor::StartRenderingInternal() { 312 void WebMediaPlayerMSCompositor::StartRenderingInternal() {
307 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 313 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
308 stopped_ = false; 314 stopped_ = false;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 426 }
421 427
422 if (!rendering_frame_buffer_) { 428 if (!rendering_frame_buffer_) {
423 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( 429 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm(
424 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, 430 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks,
425 base::Unretained(this)))); 431 base::Unretained(this))));
426 } 432 }
427 } 433 }
428 434
429 } // namespace content 435 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webmediaplayer_ms_compositor.h ('k') | content/renderer/media/webmediaplayer_ms_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698