Chromium Code Reviews| Index: media/filters/vpx_video_decoder.cc |
| diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc |
| index 894f8712c70fbf8c27efdd20f3c82d898ab86910..5cc005204855297a135345fe2fa1b61b7a1a028e 100644 |
| --- a/media/filters/vpx_video_decoder.cc |
| +++ b/media/filters/vpx_video_decoder.cc |
| @@ -450,27 +450,40 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image, |
| scoped_refptr<VideoFrame>* video_frame) { |
| CHECK(vpx_image); |
| CHECK(vpx_image->fmt == VPX_IMG_FMT_I420 || |
| - vpx_image->fmt == VPX_IMG_FMT_YV12); |
| + vpx_image->fmt == VPX_IMG_FMT_YV12 || |
| + vpx_image->fmt == VPX_IMG_FMT_I444); |
| + |
| + VideoFrame::Format codec_format; |
|
scherkus (not reviewing)
2014/05/29 02:30:26
nit: we typically try to initialize variables to s
sandersd (OOO until July 31)
2014/05/29 20:39:09
Done. I don't think that it's easier to read, but
|
| + int uv_rows; |
| + |
| + if (vpx_image->fmt == VPX_IMG_FMT_I444) { |
| + CHECK(!vpx_codec_alpha_); |
| + codec_format = VideoFrame::YV24; |
| + uv_rows = vpx_image->d_h; |
| + } else { |
| + codec_format = vpx_codec_alpha_ ? VideoFrame::YV12A : VideoFrame::YV12; |
| + uv_rows = (vpx_image->d_h + 1) / 2; |
| + } |
| gfx::Size size(vpx_image->d_w, vpx_image->d_h); |
| if (!vpx_codec_alpha_ && memory_pool_) { |
| *video_frame = VideoFrame::WrapExternalYuvData( |
| - VideoFrame::YV12, |
| - size, gfx::Rect(size), config_.natural_size(), |
| - vpx_image->stride[VPX_PLANE_Y], |
| - vpx_image->stride[VPX_PLANE_U], |
| - vpx_image->stride[VPX_PLANE_V], |
| - vpx_image->planes[VPX_PLANE_Y], |
| - vpx_image->planes[VPX_PLANE_U], |
| - vpx_image->planes[VPX_PLANE_V], |
| - kNoTimestamp(), |
| - memory_pool_->CreateFrameCallback(vpx_image->fb_priv)); |
| + codec_format, |
| + size, gfx::Rect(size), config_.natural_size(), |
| + vpx_image->stride[VPX_PLANE_Y], |
| + vpx_image->stride[VPX_PLANE_U], |
| + vpx_image->stride[VPX_PLANE_V], |
| + vpx_image->planes[VPX_PLANE_Y], |
| + vpx_image->planes[VPX_PLANE_U], |
| + vpx_image->planes[VPX_PLANE_V], |
| + kNoTimestamp(), |
| + memory_pool_->CreateFrameCallback(vpx_image->fb_priv)); |
| return; |
| } |
| *video_frame = frame_pool_.CreateFrame( |
| - vpx_codec_alpha_ ? VideoFrame::YV12A : VideoFrame::YV12, |
| + codec_format, |
| size, |
| gfx::Rect(size), |
| config_.natural_size(), |
| @@ -482,11 +495,11 @@ void VpxVideoDecoder::CopyVpxImageTo(const vpx_image* vpx_image, |
| video_frame->get()); |
| CopyUPlane(vpx_image->planes[VPX_PLANE_U], |
| vpx_image->stride[VPX_PLANE_U], |
| - (vpx_image->d_h + 1) / 2, |
| + uv_rows, |
| video_frame->get()); |
| CopyVPlane(vpx_image->planes[VPX_PLANE_V], |
| vpx_image->stride[VPX_PLANE_V], |
| - (vpx_image->d_h + 1) / 2, |
| + uv_rows, |
| video_frame->get()); |
| if (!vpx_codec_alpha_) |
| return; |