OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/blink/skcanvas_video_renderer.h" | 5 #include "media/blink/skcanvas_video_renderer.h" |
6 | 6 |
7 #include "gpu/GLES2/gl2extchromium.h" | 7 #include "gpu/GLES2/gl2extchromium.h" |
8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
9 #include "gpu/command_buffer/common/mailbox_holder.h" | 9 #include "gpu/command_buffer/common/mailbox_holder.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
131 return !video_frame->HasTextures() || | 131 return !video_frame->HasTextures() || |
132 media::VideoFrame::NumPlanes(video_frame->format()) != 1 || | 132 media::VideoFrame::NumPlanes(video_frame->format()) != 1 || |
133 video_frame->mailbox_holder(0).texture_target != GL_TEXTURE_2D; | 133 video_frame->mailbox_holder(0).texture_target != GL_TEXTURE_2D; |
134 } | 134 } |
135 | 135 |
136 // Creates a SkImage from a |video_frame| backed by native resources. | 136 // Creates a SkImage from a |video_frame| backed by native resources. |
137 // The SkImage will take ownership of the underlying resource. | 137 // The SkImage will take ownership of the underlying resource. |
138 skia::RefPtr<SkImage> NewSkImageFromVideoFrameNative( | 138 skia::RefPtr<SkImage> NewSkImageFromVideoFrameNative( |
139 VideoFrame* video_frame, | 139 VideoFrame* video_frame, |
140 const Context3D& context_3d) { | 140 const Context3D& context_3d) { |
141 DCHECK_EQ(PIXEL_FORMAT_ARGB, video_frame->format()); | 141 DCHECK(PIXEL_FORMAT_ARGB == video_frame->format() || |
142 PIXEL_FORMAT_UYVY == video_frame->format()); | |
reveman
2015/08/21 21:53:03
and why this change?
Daniele Castagna
2015/08/21 22:46:04
Same as the above, if the VideoFrame gets converte
reveman
2015/08/22 14:04:46
what is this format used for? determines how to sa
| |
142 | 143 |
143 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(0); | 144 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(0); |
144 DCHECK(mailbox_holder.texture_target == GL_TEXTURE_2D || | 145 DCHECK(mailbox_holder.texture_target == GL_TEXTURE_2D || |
145 mailbox_holder.texture_target == GL_TEXTURE_RECTANGLE_ARB || | 146 mailbox_holder.texture_target == GL_TEXTURE_RECTANGLE_ARB || |
146 mailbox_holder.texture_target == GL_TEXTURE_EXTERNAL_OES) | 147 mailbox_holder.texture_target == GL_TEXTURE_EXTERNAL_OES) |
147 << mailbox_holder.texture_target; | 148 << mailbox_holder.texture_target; |
148 | 149 |
149 gpu::gles2::GLES2Interface* gl = context_3d.gl; | 150 gpu::gles2::GLES2Interface* gl = context_3d.gl; |
150 unsigned source_texture = 0; | 151 unsigned source_texture = 0; |
151 if (mailbox_holder.texture_target != GL_TEXTURE_2D) { | 152 if (mailbox_holder.texture_target != GL_TEXTURE_2D) { |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
584 video_frame->UpdateReleaseSyncPoint(&client); | 585 video_frame->UpdateReleaseSyncPoint(&client); |
585 } | 586 } |
586 | 587 |
587 void SkCanvasVideoRenderer::ResetCache() { | 588 void SkCanvasVideoRenderer::ResetCache() { |
588 // Clear cached values. | 589 // Clear cached values. |
589 last_image_ = nullptr; | 590 last_image_ = nullptr; |
590 last_timestamp_ = kNoTimestamp(); | 591 last_timestamp_ = kNoTimestamp(); |
591 } | 592 } |
592 | 593 |
593 } // namespace media | 594 } // namespace media |
OLD | NEW |