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