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

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: whoops, lost dark_grey.png during rebasing somehow. 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') | cc/quads/yuv_video_draw_quad.h » ('J')
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 bool has_jpeg_color_range = frame_->format() == media::VideoFrame::YV12J;
186 gfx::RectF tex_coord_rect( 187 gfx::RectF tex_coord_rect(
187 tex_x_offset, tex_y_offset, tex_width_scale, tex_height_scale); 188 tex_x_offset, tex_y_offset, tex_width_scale, tex_height_scale);
188 scoped_ptr<YUVVideoDrawQuad> yuv_video_quad = YUVVideoDrawQuad::Create(); 189 scoped_ptr<YUVVideoDrawQuad> yuv_video_quad = YUVVideoDrawQuad::Create();
189 yuv_video_quad->SetNew( 190 yuv_video_quad->SetNew(
190 shared_quad_state, 191 shared_quad_state,
191 quad_rect, 192 quad_rect,
192 opaque_rect, 193 opaque_rect,
193 visible_quad_rect, 194 visible_quad_rect,
194 tex_coord_rect, 195 tex_coord_rect,
195 frame_resources_[0], 196 frame_resources_[0],
196 frame_resources_[1], 197 frame_resources_[1],
197 frame_resources_[2], 198 frame_resources_[2],
198 frame_resources_.size() > 3 ? frame_resources_[3] : 0); 199 frame_resources_.size() > 3 ? frame_resources_[3] : 0,
200 has_jpeg_color_range);
199 quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>()); 201 quad_sink->Append(yuv_video_quad.PassAs<DrawQuad>());
200 break; 202 break;
201 } 203 }
202 case VideoFrameExternalResources::RGB_RESOURCE: { 204 case VideoFrameExternalResources::RGB_RESOURCE: {
203 DCHECK_EQ(frame_resources_.size(), 1u); 205 DCHECK_EQ(frame_resources_.size(), 1u);
204 if (frame_resources_.size() < 1u) 206 if (frame_resources_.size() < 1u)
205 break; 207 break;
206 bool premultiplied_alpha = true; 208 bool premultiplied_alpha = true;
207 gfx::PointF uv_top_left(0.f, 0.f); 209 gfx::PointF uv_top_left(0.f, 0.f);
208 gfx::PointF uv_bottom_right(tex_width_scale, tex_height_scale); 210 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( 327 void VideoLayerImpl::SetProviderClientImpl(
326 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { 328 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) {
327 provider_client_impl_ = provider_client_impl; 329 provider_client_impl_ = provider_client_impl;
328 } 330 }
329 331
330 const char* VideoLayerImpl::LayerTypeAsString() const { 332 const char* VideoLayerImpl::LayerTypeAsString() const {
331 return "cc::VideoLayerImpl"; 333 return "cc::VideoLayerImpl";
332 } 334 }
333 335
334 } // namespace cc 336 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | cc/quads/yuv_video_draw_quad.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698