author | Nanxin Qin <nanxin.qin@amlogic.com> | 2020-06-01 05:50:35 (GMT) |
---|---|---|
committer | Nanxin Qin <nanxin.qin@amlogic.com> | 2020-06-01 05:59:20 (GMT) |
commit | fa7c05487366fcd7af13b12cc98f24d7a4ea814b (patch) | |
tree | da837942a178d9a14de32a74dedd519eea7b5fc0 | |
parent | 475e80ac80c2d703590ec82342f24d954fdcbd74 (diff) | |
download | media_modules-fa7c05487366fcd7af13b12cc98f24d7a4ea814b.zip media_modules-fa7c05487366fcd7af13b12cc98f24d7a4ea814b.tar.gz media_modules-fa7c05487366fcd7af13b12cc98f24d7a4ea814b.tar.bz2 |
v4l: fixed issue of the visiable get fail. [1/1]
PD#SWPL-27086
Problem:
GStreamer's V4L2 decoder reports wrong buffer resolution.
Solution:
the interface of get selection need be invoked on mplane as well.
Verify:
w200
Change-Id: I2a04be6c8066fda781518d8be72356c4438dd70d
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
-rw-r--r-- | drivers/amvdec_ports/aml_vcodec_dec.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c index fb88ce5..bf600ca 100644 --- a/drivers/amvdec_ports/aml_vcodec_dec.c +++ b/drivers/amvdec_ports/aml_vcodec_dec.c @@ -1588,24 +1588,14 @@ static int vidioc_vdec_g_selection(struct file *file, void *priv, struct aml_vcodec_ctx *ctx = fh_to_ctx(priv); struct aml_q_data *q_data; - if (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + if ((s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) && + (s->type != V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)) return -EINVAL; q_data = &ctx->q_data[AML_Q_DATA_DST]; switch (s->target) { case V4L2_SEL_TGT_COMPOSE_DEFAULT: - s->r.left = 0; - s->r.top = 0; - s->r.width = ctx->picinfo.visible_width; - s->r.height = ctx->picinfo.visible_height; - break; - case V4L2_SEL_TGT_COMPOSE_BOUNDS: - s->r.left = 0; - s->r.top = 0; - s->r.width = ctx->picinfo.coded_width; - s->r.height = ctx->picinfo.coded_height; - break; case V4L2_SEL_TGT_COMPOSE: if (vdec_if_get_param(ctx, GET_PARAM_CROP_INFO, &(s->r))) { /* set to default value if header info not ready yet*/ @@ -1615,6 +1605,12 @@ static int vidioc_vdec_g_selection(struct file *file, void *priv, s->r.height = q_data->visible_height; } break; + case V4L2_SEL_TGT_COMPOSE_BOUNDS: + s->r.left = 0; + s->r.top = 0; + s->r.width = ctx->picinfo.coded_width; + s->r.height = ctx->picinfo.coded_height; + break; default: return -EINVAL; } |