pwc
[Top] [All Lists]

[pwc] [PATCH] PWC: Support VIDIOC_?_PARM ioctls

To: Philips Webcam Linux Driver <>, Linux and Kernel Video <>, Luc Saillard <>
Subject: [pwc] [PATCH] PWC: Support VIDIOC_?_PARM ioctls
From: Gregor Jasny <>
Date: Mon, 23 Apr 2007 15:11:39 +0200
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
<Prev in Thread] Current Thread [Next in Thread>
  • [pwc] [PATCH] PWC: Support VIDIOC_?_PARM ioctls, Gregor Jasny <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU