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

Unified Diff: content/renderer/media/webmediaplayer_ms.cc

Issue 2127053004: Optimize webgl texImage2D from YUV video textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@skianocopy
Patch Set: remove unnecessary change Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webmediaplayer_ms.cc
diff --git a/content/renderer/media/webmediaplayer_ms.cc b/content/renderer/media/webmediaplayer_ms.cc
index 33d410990f530376a8b8e698168038a852fe0818..8d7ed8b7b9bd87d90c14c14164d9e968772ff884 100644
--- a/content/renderer/media/webmediaplayer_ms.cc
+++ b/content/renderer/media/webmediaplayer_ms.cc
@@ -465,15 +465,20 @@ bool WebMediaPlayerMS::copyVideoTextureToPlatformTexture(
scoped_refptr<media::VideoFrame> video_frame =
compositor_->GetCurrentFrameWithoutUpdatingStatistics();
- if (!video_frame.get() || !video_frame->HasTextures() ||
- media::VideoFrame::NumPlanes(video_frame->format()) != 1) {
+ if (!video_frame.get() || !video_frame->HasTextures())
return false;
- }
- media::SkCanvasVideoRenderer::CopyVideoFrameSingleTextureToGLTexture(
- gl, video_frame.get(), texture, internal_format, type, premultiply_alpha,
- flip_y);
- return true;
+ media::Context3D context_3d;
+ auto* provider =
+ RenderThreadImpl::current()->SharedMainThreadContextProvider().get();
+ // GPU Process crashed.
+ if (!provider)
+ return false;
+ context_3d = media::Context3D(provider->ContextGL(), provider->GrContext());
+ DCHECK(context_3d.gl);
+ return video_renderer_.CopyVideoFrameTexturesToGLTexture(
+ context_3d, gl, video_frame.get(), texture, internal_format, type,
+ premultiply_alpha, flip_y);
}
void WebMediaPlayerMS::OnFrameAvailable(
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698