From e331f4a9bbcd3d2cefccbfe58950d47e4490b1bd Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Tue, 8 Aug 2006 09:10:07 -0300 Subject: [PATCH] --- yaml --- r: 37335 b: refs/heads/master c: e95a191566685530ef49b702bbce0a33c57c3136 h: refs/heads/master i: 37333: ed7ea2d2796de1e560999c84f7768b320c462d54 37331: 8077ff2b6aca85958f678832982688c38ac03d0e 37327: 40891d5492d34f8eaded721613e16da2250311d3 v: v3 --- [refs] | 2 +- .../media/video/pvrusb2/pvrusb2-v4l2.c | 36 ++++++++++--------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/[refs] b/[refs] index 7c231876849a..d9a18be6136f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 434449f4c8902198e6fa90023f60395230f36c23 +refs/heads/master: e95a191566685530ef49b702bbce0a33c57c3136 diff --git a/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 0caf70b8c0de..5f5438aca136 100644 --- a/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -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], @@ -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: