[media] v4l/s5p-mfc: added image size align in VIDIOC_TRY_FMT
authorAndrzej Hajda <a.hajda@samsung.com>
Tue, 12 Jun 2012 12:46:26 +0000 (09:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 18 Jun 2012 22:48:14 +0000 (19:48 -0300)
Image size for MFC encoder should have size between
8x4 and 1920x1080 with even width and height.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/s5p-mfc/s5p_mfc_enc.c

index 9c19aa8038dd809fbdff061727f04836ac4117be..03d83340e7fb6bcaaded17b1da810610a8c40ad7 100644 (file)
@@ -901,6 +901,8 @@ static int vidioc_try_fmt(struct file *file, void *priv, struct v4l2_format *f)
                        mfc_err("failed to try output format\n");
                        return -EINVAL;
                }
+               v4l_bound_align_image(&pix_fmt_mp->width, 8, 1920, 1,
+                       &pix_fmt_mp->height, 4, 1080, 1, 0);
        } else {
                mfc_err("invalid buf type\n");
                return -EINVAL;