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

Side by Side Diff: cc/layers/video_layer_impl.cc

Issue 92703003: Support videos with JPEG color range in GPU YUV convert path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@yuv_v2
Patch Set: Add missing 'f' to float literal to make VS happy Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/layers/video_layer_impl.h" 5 #include "cc/layers/video_layer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/layers/quad_sink.h" 9 #include "cc/layers/quad_sink.h"
10 #include "cc/layers/video_frame_provider_client_impl.h" 10 #include "cc/layers/video_frame_provider_client_impl.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 SK_ColorTRANSPARENT, 176 SK_ColorTRANSPARENT,
177 opacity, 177 opacity,
178 flipped); 178 flipped);
179 quad_sink->Append(texture_quad.PassAs<DrawQuad>()); 179 quad_sink->Append(texture_quad.PassAs<DrawQuad>());
180 break; 180 break;
181 } 181 }
182 case VideoFrameExternalResources::YUV_RESOURCE: { 182 case VideoFrameExternalResources::YUV_RESOURCE: {
183 DCHECK_GE(frame_resources_.size(), 3u); 183 DCHECK_GE(frame_resources_.size(), 3u);
184 if (frame_resources_.size() < 3u) 184 if (frame_resources_.size() < 3u)
185 break; 185 break;
186 YUVVideoDrawQuad::ColorSpace color_space =
187 frame_->format() == media::VideoFrame::YV12J
188 ? YUVVideoDrawQuad::REC_601_JPEG
189 : YUVVideoDrawQuad::REC_601;
186 gfx::RectF tex_coord_rect( 190 gfx::RectF tex_coord_rect(
187 tex_x_offset, tex_y_offset, tex_width_scale, tex_height_scale); 191 tex_x_offset, tex_y_offset, tex_width_scale, tex_height_scale);
188 scoped_ptr<YUVVideoDrawQuad> yuv_video_quad = YUVVideoDrawQuad::Create(); 192 scoped_ptr<YUVVideoDrawQuad> yuv_video_quad = YUVVideoDrawQuad::Create();
189 yuv_video_quad->SetNew( 193 yuv_video_quad->SetNew(
190 shared_quad_state, 194 shared_quad_state,
191 quad_rect, 195 quad_rect,
192 opaque_rect, 196 opaque_rect,
193 visible_quad_rect, 197 visible_quad_rect,
194 tex_coord_rect, 198 tex_coord_rect,
195 frame_resources_[0], 199 frame_resources_[0],
196 frame_resources_[1], 200 frame_resources_[1],
197 frame_resources_[2], 201 frame_resources_[2],
198 frame_resources_.size() > 3 ? frame_resources_[3] : 0); 202 frame_resources_.size() > 3 ? frame_resources_[3] : 0,
203 color_space);
199 quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>()); 204 quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>());
200 break; 205 break;
201 } 206 }
202 case VideoFrameExternalResources::RGB_RESOURCE: { 207 case VideoFrameExternalResources::RGB_RESOURCE: {
203 DCHECK_EQ(frame_resources_.size(), 1u); 208 DCHECK_EQ(frame_resources_.size(), 1u);
204 if (frame_resources_.size() < 1u) 209 if (frame_resources_.size() < 1u)
205 break; 210 break;
206 bool premultiplied_alpha = true; 211 bool premultiplied_alpha = true;
207 gfx::PointF uv_top_left(0.f, 0.f); 212 gfx::PointF uv_top_left(0.f, 0.f);
208 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); 213 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 void VideoLayerImpl::SetProviderClientImpl( 330 void VideoLayerImpl::SetProviderClientImpl(
326 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { 331 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) {
327 provider_client_impl_ = provider_client_impl; 332 provider_client_impl_ = provider_client_impl;
328 } 333 }
329 334
330 const char* VideoLayerImpl::LayerTypeAsString() const { 335 const char* VideoLayerImpl::LayerTypeAsString() const {
331 return "cc::VideoLayerImpl"; 336 return "cc::VideoLayerImpl";
332 } 337 }
333 338
334 } // namespace cc 339 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698