Commit 4a357000 authored by Nícolas F. R. A. Prado's avatar Nícolas F. R. A. Prado Committed by Hans Verkuil

Revert "media: mediatek: vcodec: Fix bitstream crop information error"

This reverts commit cd61f3c6. That
commit's purpose was to prevent the padding from being decoded when
userspace didn't set a selection, relying on the default one.

However, as described in the Step 6 of the Initialization procedure for
the Memory-to-Memory Stateful Video Encoder Interface [1]:

"Set the visible resolution for the stream metadata via
VIDIOC_S_SELECTION() on the OUTPUT queue if it is desired to be
different than the full OUTPUT resolution."

And from the Note:

"To avoid encoding the padding, the client needs to explicitly configure
this selection target"

Hence the behavior in the original commit doesn't follow the interface
and needs to be reverted.

This fixes the following v4l2-compliance failure observed on
mt8192-asurada-spherion:

		fail: v4l2-test-formats.cpp(924): sel.r.width != fmt.g_width()
	test VIDIOC_S_FMT: FAIL

[1] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/dev-encoder.html#initializationSigned-off-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Tested-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 56b5c3e6
...@@ -505,13 +505,13 @@ static int vidioc_venc_s_fmt_out(struct file *file, void *priv, ...@@ -505,13 +505,13 @@ static int vidioc_venc_s_fmt_out(struct file *file, void *priv,
f->fmt.pix.pixelformat = fmt->fourcc; f->fmt.pix.pixelformat = fmt->fourcc;
} }
q_data->visible_width = f->fmt.pix_mp.width; ret = vidioc_try_fmt_out(ctx, f, fmt);
q_data->visible_height = f->fmt.pix_mp.height;
q_data->fmt = fmt;
ret = vidioc_try_fmt_out(ctx, f, q_data->fmt);
if (ret) if (ret)
return ret; return ret;
q_data->fmt = fmt;
q_data->visible_width = f->fmt.pix_mp.width;
q_data->visible_height = f->fmt.pix_mp.height;
q_data->coded_width = f->fmt.pix_mp.width; q_data->coded_width = f->fmt.pix_mp.width;
q_data->coded_height = f->fmt.pix_mp.height; q_data->coded_height = f->fmt.pix_mp.height;
......
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