Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37335
b: refs/heads/master
c: e95a191
h: refs/heads/master
i:
  37333: ed7ea2d
  37331: 8077ff2
  37327: 40891d5
v: v3
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Sep 26, 2006
1 parent df90634 commit e331f4a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 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: 434449f4c8902198e6fa90023f60395230f36c23
refs/heads/master: e95a191566685530ef49b702bbce0a33c57c3136
36 changes: 19 additions & 17 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,18 +459,26 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
ret = 0;
switch(vf->type) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
int lmin,lmax;
struct pvr2_ctrl *hcp,*vcp;
int h = vf->fmt.pix.height;
int w = vf->fmt.pix.width;

if (h < 200) {
h = 200;
} else if (h > 625) {
h = 625;
hcp = pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_HRES);
vcp = pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_VRES);

lmin = pvr2_ctrl_get_min(hcp);
lmax = pvr2_ctrl_get_max(hcp);
if (h < lmin) {
h = lmin;
} else if (h > lmax) {
h = lmax;
}
if (w < 320) {
w = 320;
} else if (w > 720) {
w = 720;
lmin = pvr2_ctrl_get_min(vcp);
lmax = pvr2_ctrl_get_max(vcp);
if (w < lmin) {
w = lmin;
} else if (w > lmax) {
w = lmax;
}

memcpy(vf, &pvr_format[PVR_FORMAT_PIX],
Expand All @@ -479,14 +487,8 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
vf->fmt.pix.height = h;

if (cmd == VIDIOC_S_FMT) {
pvr2_ctrl_set_value(
pvr2_hdw_get_ctrl_by_id(hdw,
PVR2_CID_HRES),
vf->fmt.pix.width);
pvr2_ctrl_set_value(
pvr2_hdw_get_ctrl_by_id(hdw,
PVR2_CID_VRES),
vf->fmt.pix.height);
pvr2_ctrl_set_value(hcp,vf->fmt.pix.width);
pvr2_ctrl_set_value(vcp,vf->fmt.pix.height);
}
} break;
case V4L2_BUF_TYPE_VBI_CAPTURE:
Expand Down

0 comments on commit e331f4a

Please sign in to comment.