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

Side by Side Diff: content/renderer/media/webmediaplayer_ms.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 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 #include "content/renderer/media/webmediaplayer_ms.h" 5 #include "content/renderer/media/webmediaplayer_ms.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 return true; 321 return true;
322 } 322 }
323 323
324 void WebMediaPlayerMS::paint(blink::WebCanvas* canvas, 324 void WebMediaPlayerMS::paint(blink::WebCanvas* canvas,
325 const blink::WebRect& rect, 325 const blink::WebRect& rect,
326 unsigned char alpha, 326 unsigned char alpha,
327 SkXfermode::Mode mode) { 327 SkXfermode::Mode mode) {
328 DVLOG(3) << __FUNCTION__; 328 DVLOG(3) << __FUNCTION__;
329 DCHECK(thread_checker_.CalledOnValidThread()); 329 DCHECK(thread_checker_.CalledOnValidThread());
330 330
331 const scoped_refptr<media::VideoFrame> frame = compositor_->GetCurrentFrame(); 331 const scoped_refptr<media::VideoFrame> frame = compositor_->current_frame();
332 332
333 media::Context3D context_3d; 333 media::Context3D context_3d;
334 if (frame && frame->HasTextures()) { 334 if (frame && frame->HasTextures()) {
335 cc::ContextProvider* provider = 335 cc::ContextProvider* provider =
336 RenderThreadImpl::current()->SharedMainThreadContextProvider().get(); 336 RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
337 // GPU Process crashed. 337 // GPU Process crashed.
338 if (!provider) 338 if (!provider)
339 return; 339 return;
340 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext()); 340 context_3d = media::Context3D(provider->ContextGL(), provider->GrContext());
341 DCHECK(context_3d.gl); 341 DCHECK(context_3d.gl);
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 bool WebMediaPlayerMS::copyVideoTextureToPlatformTexture( 445 bool WebMediaPlayerMS::copyVideoTextureToPlatformTexture(
446 gpu::gles2::GLES2Interface* gl, 446 gpu::gles2::GLES2Interface* gl,
447 unsigned int texture, 447 unsigned int texture,
448 unsigned int internal_format, 448 unsigned int internal_format,
449 unsigned int type, 449 unsigned int type,
450 bool premultiply_alpha, 450 bool premultiply_alpha,
451 bool flip_y) { 451 bool flip_y) {
452 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture"); 452 TRACE_EVENT0("media", "WebMediaPlayerMS:copyVideoTextureToPlatformTexture");
453 DCHECK(thread_checker_.CalledOnValidThread()); 453 DCHECK(thread_checker_.CalledOnValidThread());
454 454
455 scoped_refptr<media::VideoFrame> video_frame = compositor_->GetCurrentFrame(); 455 scoped_refptr<media::VideoFrame> video_frame = compositor_->current_frame();
456 456
457 if (!video_frame.get() || !video_frame->HasTextures() || 457 if (!video_frame.get() || !video_frame->HasTextures() ||
458 media::VideoFrame::NumPlanes(video_frame->format()) != 1) { 458 media::VideoFrame::NumPlanes(video_frame->format()) != 1) {
459 return false; 459 return false;
460 } 460 }
461 461
462 media::SkCanvasVideoRenderer::CopyVideoFrameSingleTextureToGLTexture( 462 media::SkCanvasVideoRenderer::CopyVideoFrameSingleTextureToGLTexture(
463 gl, video_frame.get(), texture, internal_format, type, premultiply_alpha, 463 gl, video_frame.get(), texture, internal_format, type, premultiply_alpha,
464 flip_y); 464 flip_y);
465 return true; 465 return true;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 void WebMediaPlayerMS::ResetCanvasCache() { 532 void WebMediaPlayerMS::ResetCanvasCache() {
533 DCHECK(thread_checker_.CalledOnValidThread()); 533 DCHECK(thread_checker_.CalledOnValidThread());
534 video_renderer_.ResetCache(); 534 video_renderer_.ResetCache();
535 } 535 }
536 536
537 void WebMediaPlayerMS::TriggerResize() { 537 void WebMediaPlayerMS::TriggerResize() {
538 get_client()->sizeChanged(); 538 get_client()->sizeChanged();
539 } 539 }
540 540
541 } // namespace content 541 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698