Commit 293959b6 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

media/gpu/v4l2: fix V4L2Queue::SetFormat()

V4L2Queue::SetFormat(), which has just been introduced, has a serious
bug: it always tries to set the format on the CAPTURE queue. This error
slept in because I forgot to test with --use_vd.

Bug: 1003223
Test: video_decode_accelerator_tests --use_vd passes on Kevin.

Change-Id: Ibfb9684e66ea0d1f64801935ad6bc2c5460c03d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1844518
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: default avatarChih-Yu Huang <akahuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703212}
parent 86b64ffd
......@@ -795,7 +795,7 @@ base::Optional<struct v4l2_format> V4L2Queue::SetFormat(uint32_t fourcc,
const gfx::Size& size,
size_t buffer_size) {
struct v4l2_format format = {};
format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
format.type = type_;
format.fmt.pix_mp.pixelformat = fourcc;
format.fmt.pix_mp.width = size.width();
format.fmt.pix_mp.height = size.height();
......@@ -803,7 +803,8 @@ base::Optional<struct v4l2_format> V4L2Queue::SetFormat(uint32_t fourcc,
format.fmt.pix_mp.plane_fmt[0].sizeimage = buffer_size;
if (device_->Ioctl(VIDIOC_S_FMT, &format) != 0 ||
format.fmt.pix_mp.pixelformat != fourcc) {
VPLOGF(2) << "Failed to set output format. format_fourcc=" << fourcc;
VPLOGF(2) << "Failed to set format on queue " << type_
<< ". format_fourcc=0x" << std::hex << fourcc;
return base::nullopt;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment