aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2012-08-06 09:37:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-08-11 14:50:52 -0400
commit77747f7960986e6a2210a837e6c76a68145d0bf9 (patch)
treeedfd66526094f0d0912f32ace59c33e063ca4e61
parent0a3a8a36d9aae7ce08d5bd437ab670a78b327e5d (diff)
[media] vivi: add frame size reporting
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/vivi.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 463564f0e3c2..cfa6a421c0a2 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -991,6 +991,27 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
991 return 0; 991 return 0;
992} 992}
993 993
994static int vidioc_enum_framesizes(struct file *file, void *fh,
995 struct v4l2_frmsizeenum *fsize)
996{
997 static const struct v4l2_frmsize_stepwise sizes = {
998 48, MAX_WIDTH, 4,
999 32, MAX_HEIGHT, 1
1000 };
1001 int i;
1002
1003 if (fsize->index)
1004 return -EINVAL;
1005 for (i = 0; i < ARRAY_SIZE(formats); i++)
1006 if (formats[i].fourcc == fsize->pixel_format)
1007 break;
1008 if (i == ARRAY_SIZE(formats))
1009 return -EINVAL;
1010 fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
1011 fsize->stepwise = sizes;
1012 return 0;
1013}
1014
994/* only one input in this sample driver */ 1015/* only one input in this sample driver */
995static int vidioc_enum_input(struct file *file, void *priv, 1016static int vidioc_enum_input(struct file *file, void *priv,
996 struct v4l2_input *inp) 1017 struct v4l2_input *inp)
@@ -1175,6 +1196,7 @@ static const struct v4l2_ioctl_ops vivi_ioctl_ops = {
1175 .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap, 1196 .vidioc_g_fmt_vid_cap = vidioc_g_fmt_vid_cap,
1176 .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap, 1197 .vidioc_try_fmt_vid_cap = vidioc_try_fmt_vid_cap,
1177 .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap, 1198 .vidioc_s_fmt_vid_cap = vidioc_s_fmt_vid_cap,
1199 .vidioc_enum_framesizes = vidioc_enum_framesizes,
1178 .vidioc_reqbufs = vb2_ioctl_reqbufs, 1200 .vidioc_reqbufs = vb2_ioctl_reqbufs,
1179 .vidioc_create_bufs = vb2_ioctl_create_bufs, 1201 .vidioc_create_bufs = vb2_ioctl_create_bufs,
1180 .vidioc_prepare_buf = vb2_ioctl_prepare_buf, 1202 .vidioc_prepare_buf = vb2_ioctl_prepare_buf,