Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124390
b: refs/heads/master
c: 627a5ef
h: refs/heads/master
v: v3
  • Loading branch information
Jim Paris authored and Mauro Carvalho Chehab committed Dec 30, 2008
1 parent c0e9ca4 commit 5a3c42d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c06eb61941459b1981817fb675d0104ac0cd6df8
refs/heads/master: 627a5ef7893fa127925b99e2597c8210202c75aa
22 changes: 22 additions & 0 deletions trunk/drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,17 @@ static int vidioc_g_parm(struct file *filp, void *priv,
memset(parm, 0, sizeof *parm);
parm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
parm->parm.capture.readbuffers = gspca_dev->nbufread;

if (gspca_dev->sd_desc->get_streamparm) {
int ret;

if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
ret = gspca_dev->sd_desc->get_streamparm(gspca_dev, parm);
mutex_unlock(&gspca_dev->usb_lock);
return ret;
}

return 0;
}

Expand All @@ -1341,6 +1352,17 @@ static int vidioc_s_parm(struct file *filp, void *priv,
parm->parm.capture.readbuffers = gspca_dev->nbufread;
else
gspca_dev->nbufread = n;

if (gspca_dev->sd_desc->set_streamparm) {
int ret;

if (mutex_lock_interruptible(&gspca_dev->usb_lock))
return -ERESTARTSYS;
ret = gspca_dev->sd_desc->set_streamparm(gspca_dev, parm);
mutex_unlock(&gspca_dev->usb_lock);
return ret;
}

return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/media/video/gspca/gspca.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ typedef void (*cam_v_op) (struct gspca_dev *);
typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *);
typedef int (*cam_jpg_op) (struct gspca_dev *,
struct v4l2_jpegcompression *);
typedef int (*cam_streamparm_op) (struct gspca_dev *,
struct v4l2_streamparm *);
typedef int (*cam_qmnu_op) (struct gspca_dev *,
struct v4l2_querymenu *);
typedef void (*cam_pkt_op) (struct gspca_dev *gspca_dev,
Expand Down Expand Up @@ -106,6 +108,8 @@ struct sd_desc {
cam_jpg_op get_jcomp;
cam_jpg_op set_jcomp;
cam_qmnu_op querymenu;
cam_streamparm_op get_streamparm;
cam_streamparm_op set_streamparm;
};

/* packet types when moving from iso buf to frame buf */
Expand Down

0 comments on commit 5a3c42d

Please sign in to comment.