diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2009-05-25 20:04:22 +0200 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2009-05-25 20:04:22 +0200 |
commit | a13b9f748066480bddab6794014d6d39217a1ab6 (patch) | |
tree | 8b044b3dbdfbfaa5272181254da8611077ca1716 /linux | |
parent | 98b4c4078e4d51a889a86cead6c03d1b6c8a5b3d (diff) | |
download | mediapointer-dvb-s2-a13b9f748066480bddab6794014d6d39217a1ab6.tar.gz mediapointer-dvb-s2-a13b9f748066480bddab6794014d6d39217a1ab6.tar.bz2 |
gspca - main: VIDIOC_ENUM_FRAMESIZES ioctl added.
From: Hans de Goede <hdegoede@redhat.com>
Priority: normal
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c index c3c17faa3..3bf8b4866 100644 --- a/linux/drivers/media/video/gspca/gspca.c +++ b/linux/drivers/media/video/gspca/gspca.c @@ -875,6 +875,32 @@ out: return ret; } +static int vidioc_enum_framesizes(struct file *file, void *priv, + struct v4l2_frmsizeenum *fsize) +{ + struct gspca_dev *gspca_dev = priv; + int i; + __u32 index = 0; + + for (i = 0; i < gspca_dev->cam.nmodes; i++) { + if (fsize->pixel_format != + gspca_dev->cam.cam_mode[i].pixelformat) + continue; + + if (fsize->index == index) { + fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE; + fsize->discrete.width = + gspca_dev->cam.cam_mode[i].width; + fsize->discrete.height = + gspca_dev->cam.cam_mode[i].height; + return 0; + } + index++; + } + + return -EINVAL; +} + static void gspca_release(struct video_device *vfd) { struct gspca_dev *gspca_dev = container_of(vfd, struct gspca_dev, vdev); @@ -1870,6 +1896,7 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = { .vidioc_g_parm = vidioc_g_parm, .vidioc_s_parm = vidioc_s_parm, .vidioc_s_std = vidioc_s_std, + .vidioc_enum_framesizes = vidioc_enum_framesizes, #ifdef CONFIG_VIDEO_V4L1_COMPAT .vidiocgmbuf = vidiocgmbuf, #endif |