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

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: 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> WebMediaPlayerMSCompositor::current_frame() {
299 DVLOG(3) << __FUNCTION__;
300 base::AutoLock auto_lock(current_frame_lock_);
290 return current_frame_; 301 return current_frame_;
291 } 302 }
292 303
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() { 304 void WebMediaPlayerMSCompositor::StartRendering() {
300 DCHECK(thread_checker_.CalledOnValidThread()); 305 DCHECK(thread_checker_.CalledOnValidThread());
301 compositor_task_runner_->PostTask( 306 compositor_task_runner_->PostTask(
302 FROM_HERE, base::Bind(&WebMediaPlayerMSCompositor::StartRenderingInternal, 307 FROM_HERE, base::Bind(&WebMediaPlayerMSCompositor::StartRenderingInternal,
303 weak_ptr_factory_.GetWeakPtr())); 308 weak_ptr_factory_.GetWeakPtr()));
304 } 309 }
305 310
306 void WebMediaPlayerMSCompositor::StartRenderingInternal() { 311 void WebMediaPlayerMSCompositor::StartRenderingInternal() {
307 DCHECK(compositor_task_runner_->BelongsToCurrentThread()); 312 DCHECK(compositor_task_runner_->BelongsToCurrentThread());
308 stopped_ = false; 313 stopped_ = false;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 425 }
421 426
422 if (!rendering_frame_buffer_) { 427 if (!rendering_frame_buffer_) {
423 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm( 428 rendering_frame_buffer_.reset(new media::VideoRendererAlgorithm(
424 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks, 429 base::Bind(&WebMediaPlayerMSCompositor::MapTimestampsToRenderTimeTicks,
425 base::Unretained(this)))); 430 base::Unretained(this))));
426 } 431 }
427 } 432 }
428 433
429 } // namespace content 434 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698