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

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

Issue 1964253002: Bug Fix: Rendering stuck due to thread issue of WebMediaPlayerMSCompositor (M51) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/hash.h" 10 #include "base/hash.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 283 }
284 284
285 bool WebMediaPlayerMSCompositor::HasCurrentFrame() { 285 bool WebMediaPlayerMSCompositor::HasCurrentFrame() {
286 base::AutoLock auto_lock(current_frame_lock_); 286 base::AutoLock auto_lock(current_frame_lock_);
287 return current_frame_.get() != nullptr; 287 return current_frame_.get() != nullptr;
288 } 288 }
289 289
290 scoped_refptr<media::VideoFrame> WebMediaPlayerMSCompositor::GetCurrentFrame() { 290 scoped_refptr<media::VideoFrame> WebMediaPlayerMSCompositor::GetCurrentFrame() {
291 DVLOG(3) << __FUNCTION__; 291 DVLOG(3) << __FUNCTION__;
292 base::AutoLock auto_lock(current_frame_lock_); 292 base::AutoLock auto_lock(current_frame_lock_);
293 current_frame_used_by_compositor_ = true;
294 return current_frame_;
295 }
296
297 void WebMediaPlayerMSCompositor::PutCurrentFrame() {
298 DVLOG(3) << __FUNCTION__;
299 }
300
301 scoped_refptr<media::VideoFrame>
302 WebMediaPlayerMSCompositor::GetCurrentFrameWithoutUpdatingStatistics() {
303 DVLOG(3) << __FUNCTION__;
304 base::AutoLock auto_lock(current_frame_lock_);
293 return current_frame_; 305 return current_frame_;
294 } 306 }
295 307
296 void WebMediaPlayerMSCompositor::PutCurrentFrame() {
297 DVLOG(3) << __FUNCTION__;
298 base::AutoLock auto_lock(current_frame_lock_);
299 current_frame_used_by_compositor_ = true;
300 }
301
302 void WebMediaPlayerMSCompositor::StartRendering() { 308 void WebMediaPlayerMSCompositor::StartRendering() {
303 DCHECK(thread_checker_.CalledOnValidThread()); 309 DCHECK(thread_checker_.CalledOnValidThread());
304 compositor_task_runner_->PostTask( 310 compositor_task_runner_->PostTask(
305 FROM_HERE, base::Bind(&WebMediaPlayerMSCompositor::StartRenderingInternal, 311 FROM_HERE, base::Bind(&WebMediaPlayerMSCompositor::StartRenderingInternal,
306 weak_ptr_factory_.GetWeakPtr())); 312 weak_ptr_factory_.GetWeakPtr()));
307 } 313 }
308 314
309 void WebMediaPlayerMSCompositor::StartRenderingInternal() { 315 void WebMediaPlayerMSCompositor::StartRenderingInternal() {
310 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 316 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
311 stopped_ = false; 317 stopped_ = false;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 } 429 }
424 430
425 if (!rendering_frame_buffer_) { 431 if (!rendering_frame_buffer_) {
426 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( 432 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm(
427 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, 433 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks,
428 base::Unretained(this)))); 434 base::Unretained(this))));
429 } 435 }
430 } 436 }
431 437
432 } // namespace content 438 } // 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