Chromium Code Reviews| Index: media/gpu/v4l2_video_decode_accelerator.cc |
| diff --git a/media/gpu/v4l2_video_decode_accelerator.cc b/media/gpu/v4l2_video_decode_accelerator.cc |
| index 01e650a2f3cf35fdb5581f672b957672d9a2ae06..1ec3f5740db5586a16bc049b35c41bfa4527d4ff 100644 |
| --- a/media/gpu/v4l2_video_decode_accelerator.cc |
| +++ b/media/gpu/v4l2_video_decode_accelerator.cc |
| @@ -2038,9 +2038,22 @@ uint32_t V4L2VideoDecodeAccelerator::FindImageProcessorInputFormat() { |
| } |
| uint32_t V4L2VideoDecodeAccelerator::FindImageProcessorOutputFormat() { |
| + const uint32_t kPreferredEGLImageFormat = V4L2_PIX_FMT_YVU420; |
| V4L2ImageProcessor image_processor(image_processor_device_); |
| std::vector<uint32_t> processor_output_formats = |
| image_processor.GetSupportedOutputFormats(); |
|
kcwu
2016/08/19 05:50:59
I'm wondering what if we simply push_front preferr
wuchengli
2016/08/19 06:01:42
Done. Good idea.
|
| + |
| + // Check the preferred format first. |
| + if (device_->CanCreateEGLImageFrom(kPreferredEGLImageFormat)) { |
| + std::vector<uint32_t>::iterator it = |
| + std::find(processor_output_formats.begin(), |
| + processor_output_formats.end(), kPreferredEGLImageFormat); |
| + if (it != processor_output_formats.end()) { |
|
kcwu
2016/08/19 05:50:59
swap these two if-conditions at line 2051 and 2047
wuchengli
2016/08/19 06:01:42
The code is removed.
|
| + DVLOGF(1) << "Image processor output format=" << kPreferredEGLImageFormat; |
| + return kPreferredEGLImageFormat; |
| + } |
| + } |
| + |
| for (uint32_t processor_output_format : processor_output_formats) { |
| if (device_->CanCreateEGLImageFrom(processor_output_format)) { |
| DVLOGF(1) << "Image processor output format=" << processor_output_format; |