Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 285678
b: refs/heads/master
c: 18bef42
h: refs/heads/master
v: v3
  • Loading branch information
Jean-François Moine authored and Mauro Carvalho Chehab committed Jan 6, 2012
1 parent 3528012 commit 43f4a63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 965b37a477915b75ec09cd38d077d0eee9e71abf
refs/heads/master: 18bef42c2d9a63e028261b88e9202b6d0d34292b
14 changes: 11 additions & 3 deletions trunk/drivers/media/video/gspca/gspca.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,13 +633,14 @@ static u32 which_bandwidth(struct gspca_dev *gspca_dev)
u32 bandwidth;
int i;

/* get the (max) image size */
i = gspca_dev->curr_mode;
bandwidth = gspca_dev->cam.cam_mode[i].sizeimage;

/* if the image is compressed, estimate the mean image size */
/* if the image is compressed, estimate its mean size */
if (bandwidth < gspca_dev->cam.cam_mode[i].width *
gspca_dev->cam.cam_mode[i].height)
bandwidth /= 3;
bandwidth = bandwidth * 3 / 8; /* 0.375 */

/* estimate the frame rate */
if (gspca_dev->sd_desc->get_streamparm) {
Expand All @@ -649,7 +650,14 @@ static u32 which_bandwidth(struct gspca_dev *gspca_dev)
gspca_dev->sd_desc->get_streamparm(gspca_dev, &parm);
bandwidth *= parm.parm.capture.timeperframe.denominator;
} else {
bandwidth *= 15; /* 15 fps */

/* don't hope more than 15 fps with USB 1.1 and
* image resolution >= 640x480 */
if (gspca_dev->width >= 640
&& gspca_dev->dev->speed == USB_SPEED_FULL)
bandwidth *= 15; /* 15 fps */
else
bandwidth *= 30; /* 30 fps */
}

PDEBUG(D_STREAM, "min bandwidth: %d", bandwidth);
Expand Down

0 comments on commit 43f4a63

Please sign in to comment.