Commit c00cd97d authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Commit Bot

Reland "media/gpu/v4l2svda: fix stateless API specification violation"

This is a reland of 91b0391f.

Original change's description:
> media/gpu/v4l2svda: fix stateless API specification violation
>
> The stateless API states that resolution of frames should be set on the
> OUTPUT queue, and the coded resolution read back from the CAPTURE queue.
> However we were setting the resolution on the CAPTURE queue and
> expecting the ioctl to update it to the coded resolution.
>
> This works with our current kernel drivers, but is not correct with
> respect to the stateless codec API specification. The kernel drivers
> have been updated to support the correct behavior, so carry that change
> into Chromium as well.
>
> Bug: 948534
> Test: Checked that VDA unittest passes on Kevin and Minnie with kernel
> driver fixes.
>
> Change-Id: I8f589f81ae1a7d8223235739f0748e58ac25e342
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1553124
> Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
> Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#659876}

Bug: 948534
Bug: 968392
Test: Checked that video_VideoSeek.vp8.switchres passed on Minnie.

Change-Id: Id7b2e60947a275175622ac9cfcce3a604caeb0f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1635125Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#665826}
parent 1eab99f2
......@@ -508,16 +508,28 @@ bool V4L2SliceVideoDecodeAccelerator::CreateOutputBuffers() {
DCHECK_GT(num_pictures, 0u);
DCHECK(!pic_size.IsEmpty());
// Set the frame size on the OUTPUT queue
struct v4l2_format format;
memset(&format, 0, sizeof(format));
format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
format.fmt.pix_mp.pixelformat = output_format_fourcc_;
format.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
if (device_->Ioctl(VIDIOC_G_FMT, &format) != 0) {
VPLOGF(1) << "Failed getting format of output queue";
NOTIFY_ERROR(PLATFORM_FAILURE);
return false;
}
format.fmt.pix_mp.width = pic_size.width();
format.fmt.pix_mp.height = pic_size.height();
format.fmt.pix_mp.num_planes = output_planes_count_;
if (device_->Ioctl(VIDIOC_S_FMT, &format) != 0) {
VPLOGF(1) << "Failed setting format to: " << output_format_fourcc_;
VPLOGF(1) << "Failed changing resolution of output queue";
NOTIFY_ERROR(PLATFORM_FAILURE);
return false;
}
// Get the coded size from the CAPTURE queue
memset(&format, 0, sizeof(format));
format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
if (device_->Ioctl(VIDIOC_G_FMT, &format) != 0) {
VPLOGF(1) << "Failed getting format of capture queue";
NOTIFY_ERROR(PLATFORM_FAILURE);
return false;
}
......
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