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

Unified Diff: media/blink/skcanvas_video_renderer.cc

Issue 1117423002: media: Let VideoFrame carry more than one native texture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reveman's comments. Created 5 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 side-by-side diff with in-line comments
Download patch
Index: media/blink/skcanvas_video_renderer.cc
diff --git a/media/blink/skcanvas_video_renderer.cc b/media/blink/skcanvas_video_renderer.cc
index bbfeef82b511e29d58b80ccad096cd18199f80e8..c279ecf2addb5c7946d64841d5c1bc70dbb7b043 100644
--- a/media/blink/skcanvas_video_renderer.cc
+++ b/media/blink/skcanvas_video_renderer.cc
@@ -607,14 +607,15 @@ void SkCanvasVideoRenderer::CopyVideoFrameTextureToGLTexture(
bool premultiply_alpha,
bool flip_y) {
DCHECK(video_frame && video_frame->format() == VideoFrame::NATIVE_TEXTURE);
- const gpu::MailboxHolder* mailbox_holder = video_frame->mailbox_holder();
- DCHECK(mailbox_holder->texture_target == GL_TEXTURE_2D ||
- mailbox_holder->texture_target == GL_TEXTURE_RECTANGLE_ARB ||
- mailbox_holder->texture_target == GL_TEXTURE_EXTERNAL_OES);
+ DCHECK_EQ(1u, VideoFrame::NumTextures(video_frame->texture_format()));
+ const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(0);
+ DCHECK(mailbox_holder.texture_target == GL_TEXTURE_2D ||
+ mailbox_holder.texture_target == GL_TEXTURE_RECTANGLE_ARB ||
+ mailbox_holder.texture_target == GL_TEXTURE_EXTERNAL_OES);
- gl->WaitSyncPointCHROMIUM(mailbox_holder->sync_point);
+ gl->WaitSyncPointCHROMIUM(mailbox_holder.sync_point);
uint32 source_texture = gl->CreateAndConsumeTextureCHROMIUM(
- mailbox_holder->texture_target, mailbox_holder->mailbox.name);
+ mailbox_holder.texture_target, mailbox_holder.mailbox.name);
// The video is stored in a unmultiplied format, so premultiply
// if necessary.

Powered by Google App Engine
This is Rietveld 408576698