OLD | NEW |
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/video_frame_provider_client_impl.h" | 9 #include "cc/layers/video_frame_provider_client_impl.h" |
10 #include "cc/quads/io_surface_draw_quad.h" | 10 #include "cc/quads/io_surface_draw_quad.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 SK_ColorTRANSPARENT, | 215 SK_ColorTRANSPARENT, |
216 opacity, | 216 opacity, |
217 flipped, | 217 flipped, |
218 nearest_neighbor); | 218 nearest_neighbor); |
219 break; | 219 break; |
220 } | 220 } |
221 case VideoFrameExternalResources::YUV_RESOURCE: { | 221 case VideoFrameExternalResources::YUV_RESOURCE: { |
222 DCHECK_GE(frame_resources_.size(), 3u); | 222 DCHECK_GE(frame_resources_.size(), 3u); |
223 if (frame_resources_.size() < 3u) | 223 if (frame_resources_.size() < 3u) |
224 break; | 224 break; |
225 YUVVideoDrawQuad::ColorSpace color_space = YUVVideoDrawQuad::REC_601; | 225 YUVVideoDrawQuad::ColorSpace color_space = |
226 if (frame_->format() == media::VideoFrame::YV12J) { | 226 frame_->format() == media::VideoFrame::YV12J |
227 color_space = YUVVideoDrawQuad::JPEG; | 227 ? YUVVideoDrawQuad::REC_601_JPEG |
228 } else if (frame_->format() == media::VideoFrame::YV12HD) { | 228 : YUVVideoDrawQuad::REC_601; |
229 color_space = YUVVideoDrawQuad::REC_709; | |
230 } | |
231 | |
232 gfx::RectF tex_coord_rect( | 229 gfx::RectF tex_coord_rect( |
233 tex_x_offset, tex_y_offset, tex_width_scale, tex_height_scale); | 230 tex_x_offset, tex_y_offset, tex_width_scale, tex_height_scale); |
234 YUVVideoDrawQuad* yuv_video_quad = | 231 YUVVideoDrawQuad* yuv_video_quad = |
235 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); | 232 render_pass->CreateAndAppendDrawQuad<YUVVideoDrawQuad>(); |
236 yuv_video_quad->SetNew( | 233 yuv_video_quad->SetNew( |
237 shared_quad_state, quad_rect, opaque_rect, visible_quad_rect, | 234 shared_quad_state, quad_rect, opaque_rect, visible_quad_rect, |
238 tex_coord_rect, coded_size, frame_resources_[0], frame_resources_[1], | 235 tex_coord_rect, coded_size, frame_resources_[0], frame_resources_[1], |
239 frame_resources_[2], | 236 frame_resources_[2], |
240 frame_resources_.size() > 3 ? frame_resources_[3] : 0, color_space); | 237 frame_resources_.size() > 3 ? frame_resources_[3] : 0, color_space); |
241 break; | 238 break; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 void VideoLayerImpl::SetProviderClientImpl( | 364 void VideoLayerImpl::SetProviderClientImpl( |
368 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { | 365 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl) { |
369 provider_client_impl_ = provider_client_impl; | 366 provider_client_impl_ = provider_client_impl; |
370 } | 367 } |
371 | 368 |
372 const char* VideoLayerImpl::LayerTypeAsString() const { | 369 const char* VideoLayerImpl::LayerTypeAsString() const { |
373 return "cc::VideoLayerImpl"; | 370 return "cc::VideoLayerImpl"; |
374 } | 371 } |
375 | 372 |
376 } // namespace cc | 373 } // namespace cc |
OLD | NEW |