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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2127053004: Optimize webgl texImage2D from YUV video textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@skianocopy
Patch Set: hold on to converted SkImages 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
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index c0cdfcc5c25245dd8da65c0ec0c301947fcd5b88..70294fa1f1ec092407e1a49ef85040eab3a2539c 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -804,15 +804,16 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor();
- if (!video_frame.get() || !video_frame->HasTextures() ||
- media::VideoFrame::NumPlanes(video_frame->format()) != 1) {
+ if (!video_frame.get() || !video_frame->HasTextures()) {
return false;
}
- SkCanvasVideoRenderer::CopyVideoFrameSingleTextureToGLTexture(
- gl, video_frame.get(), texture, internal_format, type, premultiply_alpha,
- flip_y);
- return true;
+ Context3D context_3d;
+ if (!context_3d_cb_.is_null())
+ context_3d = context_3d_cb_.Run();
+ return skcanvas_video_renderer_.CopyVideoFrameTexturesToGLTexture(
+ context_3d, gl, video_frame.get(), texture, internal_format, type,
+ premultiply_alpha, flip_y);
}
void WebMediaPlayerImpl::setContentDecryptionModule(

Powered by Google App Engine
This is Rietveld 408576698