diff options
author | dcastagna <dcastagna@chromium.org> | 2015-05-07 10:21:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-07 17:21:23 +0000 |
commit | fa4d1f32690b749496963058d53b90ab9e59769a (patch) | |
tree | 115ab13b9bc19d7def4cc80661c4ffeb83724b69 /media/blink/skcanvas_video_renderer.cc | |
parent | 86945fd7dbcb32c3a972c9cf72f75eec9ea22392 (diff) | |
download | chromium_src-fa4d1f32690b749496963058d53b90ab9e59769a.zip chromium_src-fa4d1f32690b749496963058d53b90ab9e59769a.tar.gz chromium_src-fa4d1f32690b749496963058d53b90ab9e59769a.tar.bz2 |
media: Let VideoFrame carry more than one native texture.
The goal of this patch is to be able to use VideoFrame to be
created and to transport three R8 textures that represent a YUV
frame.
A new enum VideoFrame::TextureFormat has been added in order to
determine how the textures attached to the VideoFrame should be
interpreted when the VideoFrame::Format is NATIVE_TEXTURE.
BUG=
Review URL: https://codereview.chromium.org/1117423002
Cr-Commit-Position: refs/heads/master@{#328783}
Diffstat (limited to 'media/blink/skcanvas_video_renderer.cc')
-rw-r--r-- | media/blink/skcanvas_video_renderer.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/media/blink/skcanvas_video_renderer.cc b/media/blink/skcanvas_video_renderer.cc index a4e5881..58aedf9 100644 --- a/media/blink/skcanvas_video_renderer.cc +++ b/media/blink/skcanvas_video_renderer.cc @@ -605,14 +605,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. |