summaryrefslogtreecommitdiff
authorSong Zhao <song.zhao@amlogic.com>2020-07-06 15:51:26 (GMT)
committer Song Zhao <song.zhao@amlogic.com>2020-07-09 08:19:29 (GMT)
commit2f328ed1523e5fc3cc04c5a966548d84e085d22d (patch)
tree3d3b8a1f78e83b8b89660156c680bee4e9dae983
parent0b61e02f592f71fd5ee1c5747f8a4c45c1a4a62e (diff)
downloadmedia_modules-2f328ed1523e5fc3cc04c5a966548d84e085d22d.zip
media_modules-2f328ed1523e5fc3cc04c5a966548d84e085d22d.tar.gz
media_modules-2f328ed1523e5fc3cc04c5a966548d84e085d22d.tar.bz2
v4l2: add interlaced field support in try_fmt [1/1]
PD#SWPL-29144 Problem: try_fmt only return V4L2_FIELD_ANY. But gstreamer v4l2 plugin want to check whether V4L2_FIELD_INTERLACED is supported or not. Solution: For H264/Mpeg2, add V4L2_FIELD_INTERLACED support. Verify: U212 + gst-launch Change-Id: I8516840b2d8e13e6795a9749c36153c7e77dc9b4 Signed-off-by: Song Zhao <song.zhao@amlogic.com>
Diffstat
-rw-r--r--drivers/amvdec_ports/aml_vcodec_dec.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/amvdec_ports/aml_vcodec_dec.c b/drivers/amvdec_ports/aml_vcodec_dec.c
index 681eb05..c8445d2 100644
--- a/drivers/amvdec_ports/aml_vcodec_dec.c
+++ b/drivers/amvdec_ports/aml_vcodec_dec.c
@@ -1487,14 +1487,20 @@ static int vidioc_try_fmt(struct v4l2_format *f, struct aml_video_fmt *fmt)
struct v4l2_pix_format_mplane *pix_fmt_mp = &f->fmt.pix_mp;
int i;
- pix_fmt_mp->field = V4L2_FIELD_NONE;
-
if (f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) {
pix_fmt_mp->num_planes = 1;
pix_fmt_mp->plane_fmt[0].bytesperline = 0;
+ if (pix_fmt_mp->pixelformat != V4L2_PIX_FMT_MPEG2 &&
+ pix_fmt_mp->pixelformat != V4L2_PIX_FMT_H264)
+ pix_fmt_mp->field = V4L2_FIELD_NONE;
+ else if (pix_fmt_mp->field != V4L2_FIELD_NONE)
+ pr_info("%s, field: %u, fmt: %u\n",
+ __func__, pix_fmt_mp->field,
+ pix_fmt_mp->pixelformat);
} else if (!V4L2_TYPE_IS_OUTPUT(f->type)) {
int tmp_w, tmp_h;
+ pix_fmt_mp->field = V4L2_FIELD_NONE;
pix_fmt_mp->height = clamp(pix_fmt_mp->height,
AML_VDEC_MIN_H,
AML_VDEC_MAX_H);