Hi,
this patch adds support for the VIDIOC_{G,S}_PARM ioctls.
The patch is against the latest v4l-dvb HG tree.
Thanks,
Gregor
This patch add support for the VIDIOC_G/S_PARM ioctls.
Signed-off-by: Gregor Jasny <>
---
diff -r 51e1cc391dd8 linux/drivers/media/video/pwc/pwc-v4l.c
--- a/linux/drivers/media/video/pwc/pwc-v4l.c Sun Apr 22 23:55:10 2007 -0300
+++ b/linux/drivers/media/video/pwc/pwc-v4l.c Mon Apr 23 14:26:33 2007 +0200
@@ -337,6 +337,38 @@ static int pwc_vidioc_set_fmt(struct pwc
}
+static int pwc_vidioc_get_parm(struct pwc_device *pdev, struct v4l2_streamparm
*parm)
+{
+ if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) {
+ return -EINVAL;
+ }
+
+ memset(parm, 0, sizeof *parm);
+ parm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ parm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME;
+ if (pdev->vsnapshot) parm->parm.capture.capturemode |=
V4L2_MODE_HIGHQUALITY;
+ parm->parm.capture.timeperframe.numerator = 1;
+ parm->parm.capture.timeperframe.denominator = pdev->vframes;
+
+ return 0;
+}
+
+static int pwc_vidioc_set_parm(struct pwc_device *pdev, struct v4l2_streamparm
*parm)
+{
+ if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE ||
+ parm->parm.capture.timeperframe.numerator != 1) {
+ return -EINVAL;
+ }
+
+ return pwc_set_video_mode(pdev,
+ pdev->view.x,
+ pdev->view.y,
+ parm->parm.capture.timeperframe.denominator,
+ pdev->vcompression,
+ parm->parm.capture.capturemode & V4L2_MODE_HIGHQUALITY);
+
+}
+
int pwc_video_do_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, void *arg)
{
@@ -1251,6 +1283,12 @@ int pwc_video_do_ioctl(struct inode *ino
return 0;
}
+ case VIDIOC_G_PARM:
+ return pwc_vidioc_get_parm(pdev, arg);
+
+ case VIDIOC_S_PARM:
+ return pwc_vidioc_set_parm(pdev, arg);
+
default:
return pwc_ioctl(pdev, cmd, arg);
} /* ..switch */
_______________________________________________
pwc mailing list
http://lists.saillard.org/mailman/listinfo/pwc
|