summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ivtv/ivtv-ioctl.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-03-10 21:59:15 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2007-03-10 21:59:15 +0100
commit53ebbef0d42f0900ccabaa27095f0d0e9db36794 (patch)
tree74d8f44b60370840e1dc4fce11477f1ca1b824ef /linux/drivers/media/video/ivtv/ivtv-ioctl.c
parent922210910e553b2b9e9495b17304a39bd3d3fe4a (diff)
downloadmediapointer-dvb-s2-53ebbef0d42f0900ccabaa27095f0d0e9db36794.tar.gz
mediapointer-dvb-s2-53ebbef0d42f0900ccabaa27095f0d0e9db36794.tar.bz2
Add VIDIOC_G/S_PRIORITY support to ivtv.
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/ivtv/ivtv-ioctl.c')
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-ioctl.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-ioctl.c b/linux/drivers/media/video/ivtv/ivtv-ioctl.c
index 8c99b8024..d52ebf554 100644
--- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c
+++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c
@@ -709,6 +709,21 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void
if (filp) id = (struct ivtv_open_id *)filp->private_data;
switch (cmd) {
+ case VIDIOC_G_PRIORITY:
+ {
+ enum v4l2_priority *p = arg;
+
+ *p = v4l2_prio_max(&itv->prio);
+ break;
+ }
+
+ case VIDIOC_S_PRIORITY:
+ {
+ enum v4l2_priority *prio = arg;
+
+ return v4l2_prio_change(&itv->prio, &id->prio, *prio);
+ }
+
case VIDIOC_QUERYCAP:{
struct v4l2_capability *vcap = arg;
@@ -1453,9 +1468,29 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp,
{
struct ivtv_open_id *id = (struct ivtv_open_id *)filp->private_data;
struct ivtv *itv = id->itv;
+ int ret;
IVTV_DEBUG_IOCTL("v4l2 ioctl 0x%08x\n", cmd);
+ /* check priority */
+ switch (cmd) {
+ case VIDIOC_S_CTRL:
+ case VIDIOC_S_STD:
+ case VIDIOC_S_INPUT:
+ case VIDIOC_S_OUTPUT:
+ case VIDIOC_S_TUNER:
+ case VIDIOC_S_FREQUENCY:
+ case VIDIOC_S_FMT:
+ case VIDIOC_S_CROP:
+ case VIDIOC_S_AUDIO:
+ case VIDIOC_S_AUDOUT:
+ case VIDIOC_S_EXT_CTRLS:
+ case VIDIOC_S_FBUF:
+ ret = v4l2_prio_check(&itv->prio, &id->prio);
+ if (ret)
+ return ret;
+ }
+
switch (cmd) {
case VIDIOC_DBG_G_REGISTER:
case VIDIOC_DBG_S_REGISTER:
@@ -1464,6 +1499,8 @@ static int ivtv_v4l2_do_ioctl(struct inode *inode, struct file *filp,
case VIDIOC_INT_RESET:
return ivtv_internal_ioctls(filp, cmd, arg);
+ case VIDIOC_G_PRIORITY:
+ case VIDIOC_S_PRIORITY:
case VIDIOC_QUERYCAP:
case VIDIOC_ENUMINPUT:
case VIDIOC_G_INPUT: