Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176783
b: refs/heads/master
c: 28ffe77
h: refs/heads/master
i:
  176781: 644a6e9
  176779: fecf016
  176775: 7ea94ed
  176767: e5de20b
v: v3
  • Loading branch information
Antonio Ospite authored and Mauro Carvalho Chehab committed Dec 16, 2009
1 parent 529b3dc commit 0e5d59c
Show file tree
Hide file tree
Showing 3 changed files with 39 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: 7bd330b44eb92b8e5ae265ab447cd317290c7aee
refs/heads/master: 28ffe77fe2faea6658870818fd0593f1a03cc018
29 changes: 29 additions & 0 deletions trunk/drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,34 @@ static int vidioc_enum_framesizes(struct file *file, void *priv,
return -EINVAL;
}

static int vidioc_enum_frameintervals(struct file *filp, void *priv,
struct v4l2_frmivalenum *fival)
{
struct gspca_dev *gspca_dev = priv;
int mode = wxh_to_mode(gspca_dev, fival->width, fival->height);
__u32 i;

if (gspca_dev->cam.mode_framerates == NULL ||
gspca_dev->cam.mode_framerates[mode].nrates == 0)
return -EINVAL;

if (fival->pixel_format !=
gspca_dev->cam.cam_mode[mode].pixelformat)
return -EINVAL;

for (i = 0; i < gspca_dev->cam.mode_framerates[mode].nrates; i++) {
if (fival->index == i) {
fival->type = V4L2_FRMSIZE_TYPE_DISCRETE;
fival->discrete.numerator = 1;
fival->discrete.denominator =
gspca_dev->cam.mode_framerates[mode].rates[i];
return 0;
}
}

return -EINVAL;
}

static void gspca_release(struct video_device *vfd)
{
struct gspca_dev *gspca_dev = container_of(vfd, struct gspca_dev, vdev);
Expand Down Expand Up @@ -1973,6 +2001,7 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = {
.vidioc_g_parm = vidioc_g_parm,
.vidioc_s_parm = vidioc_s_parm,
.vidioc_enum_framesizes = vidioc_enum_framesizes,
.vidioc_enum_frameintervals = vidioc_enum_frameintervals,
#ifdef CONFIG_VIDEO_ADV_DEBUG
.vidioc_g_register = vidioc_g_register,
.vidioc_s_register = vidioc_s_register,
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/media/video/gspca/gspca.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,20 @@ extern int gspca_debug;
/* image transfers */
#define MAX_NURBS 4 /* max number of URBs */


/* used to list framerates supported by a camera mode (resolution) */
struct framerates {
int *rates;
int nrates;
};

/* device information - set at probe time */
struct cam {
int bulk_size; /* buffer size when image transfer by bulk */
const struct v4l2_pix_format *cam_mode; /* size nmodes */
char nmodes;
const struct framerates *mode_framerates; /* must have size nmode,
* just like cam_mode */
__u8 bulk_nurbs; /* number of URBs in bulk mode
* - cannot be > MAX_NURBS
* - when 0 and bulk_size != 0 means
Expand Down

0 comments on commit 0e5d59c

Please sign in to comment.