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

Unified Diff: cc/layers/video_layer_impl.cc

Issue 1125303005: cc: VideoLayerImpl VideoFrame::TEXTURE_YUV_420 support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address hendrikw@'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
« no previous file with comments | « no previous file | cc/layers/video_layer_impl_unittest.cc » ('j') | cc/layers/video_layer_impl_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/video_layer_impl.cc
diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc
index 51719717e6d49698db972ee9c80580348524d490..21c28c6f6761ba5647928d8c776cf84d7507e907 100644
--- a/cc/layers/video_layer_impl.cc
+++ b/cc/layers/video_layer_impl.cc
@@ -221,8 +221,7 @@ void VideoLayerImpl::AppendQuads(RenderPass* render_pass,
}
case VideoFrameExternalResources::YUV_RESOURCE: {
DCHECK_GE(frame_resources_.size(), 3u);
- if (frame_resources_.size() < 3u)
- break;
+
YUVVideoDrawQuad::ColorSpace color_space = YUVVideoDrawQuad::REC_601;
if (frame_->format() == media::VideoFrame::YV12J) {
color_space = YUVVideoDrawQuad::JPEG;
@@ -231,15 +230,24 @@ void VideoLayerImpl::AppendQuads(RenderPass* render_pass,
}
const gfx::Size ya_tex_size = coded_size;
- const gfx::Size uv_tex_size = media::VideoFrame::PlaneSize(
- frame_->format(), media::VideoFrame::kUPlane, coded_size);
- DCHECK(uv_tex_size ==
- media::VideoFrame::PlaneSize(
- frame_->format(), media::VideoFrame::kVPlane, coded_size));
- if (frame_resources_.size() > 3) {
- DCHECK(ya_tex_size ==
+ gfx::Size uv_tex_size;
+
+ if (frame_->format() == media::VideoFrame::NATIVE_TEXTURE) {
+ DCHECK_EQ(media::VideoFrame::TEXTURE_YUV_420, frame_->texture_format());
+ DCHECK(visible_rect.origin().IsOrigin());
+ DCHECK(visible_rect.size() == coded_size);
+ uv_tex_size.SetSize(ya_tex_size.width() / 2, ya_tex_size.height() / 2);
danakj 2015/05/14 23:08:33 is this right if coded_size is odd?
Daniele Castagna 2015/05/14 23:26:20 No. Done.
+ } else {
+ uv_tex_size = media::VideoFrame::PlaneSize(
+ frame_->format(), media::VideoFrame::kUPlane, coded_size);
+ DCHECK(uv_tex_size ==
media::VideoFrame::PlaneSize(
- frame_->format(), media::VideoFrame::kAPlane, coded_size));
+ frame_->format(), media::VideoFrame::kVPlane, coded_size));
+ if (frame_resources_.size() > 3) {
danakj 2015/05/14 23:08:33 should this not also be true for NATIVE_TEXTURE? Y
Daniele Castagna 2015/05/14 23:26:20 NATIVE_TEXTURE doesn't support alpha channel right
danakj 2015/05/14 23:33:56 How about move this out of the else, and DCHECK th
Daniele Castagna 2015/05/14 23:52:08 Added DCHECK_EQ(3u, frame_resources_.size()) Repl
+ DCHECK(ya_tex_size ==
+ media::VideoFrame::PlaneSize(
+ frame_->format(), media::VideoFrame::kAPlane, coded_size));
+ }
}
gfx::RectF tex_coord_rect(
« no previous file with comments | « no previous file | cc/layers/video_layer_impl_unittest.cc » ('j') | cc/layers/video_layer_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698