author | Song Zhao <song.zhao@amlogic.com> | 2020-03-12 17:31:27 (GMT) |
---|---|---|
committer | Song Zhao <song.zhao@amlogic.com> | 2020-03-12 17:33:45 (GMT) |
commit | 6e0b83c43ffb9e4eac67a754abbeb8575bacaad2 (patch) | |
tree | 4fb1416a9e3ba73a97aefd7150153b7ea7c5ef1e | |
parent | e9d38915a49151458f633f9534b910ce1788c6df (diff) | |
download | media_modules-6e0b83c43ffb9e4eac67a754abbeb8575bacaad2.zip media_modules-6e0b83c43ffb9e4eac67a754abbeb8575bacaad2.tar.gz media_modules-6e0b83c43ffb9e4eac67a754abbeb8575bacaad2.tar.bz2 |
decoder: set cap_pix_fmt in vidioc_vdec_s_fmt [1/1]
PD#SWPL-21954
Problem:
vidioc_vdec_g_fmt() is not the correct place to set this fmt
Solution:
set cap_pix_fmt in vidioc_vdec_s_fmt()
Verify:
U212 with v4l2-uvm-test
Change-Id: I6174c872cb459ee7e1236d0af5dbdbbdfbd6f8ba
Signed-off-by: Song Zhao <song.zhao@amlogic.com>
-rw-r--r-- | drivers/amvdec_ports/aml_vcodec_dec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c index 0cd6fb8..99ce5d2 100644 --- a/drivers/amvdec_ports/aml_vcodec_dec.c +++ b/drivers/amvdec_ports/aml_vcodec_dec.c @@ -1699,6 +1699,9 @@ static int vidioc_vdec_s_fmt(struct file *file, void *priv, mutex_unlock(&ctx->state_lock); } + if (!V4L2_TYPE_IS_OUTPUT(f->type)) + ctx->cap_pix_fmt = pix_mp->pixelformat; + return 0; } @@ -1874,9 +1877,6 @@ static int vidioc_vdec_g_fmt(struct file *file, void *priv, return -EINVAL; } - if (!V4L2_TYPE_IS_OUTPUT(f->type)) - ctx->cap_pix_fmt = pix_mp->pixelformat; - v4l_dbg(ctx, V4L_DEBUG_CODEC_PROT, "%s, type: %u, planes: %u, fmt: %u\n", __func__, f->type, f->fmt.pix_mp.num_planes, |