diff options
author | Mike Isely <isely@pobox.com> | 2006-06-25 18:04:16 -0500 |
---|---|---|
committer | Mike Isely <isely@pobox.com> | 2006-06-25 18:04:16 -0500 |
commit | bd319f4e81f51afbe7abe0b444d016cfe70088bc (patch) | |
tree | 81e00c1677f606e42f9fb93310e6e6bce4936b0d /linux/drivers | |
parent | 314a434f53ec8071ad6fd9bd0b47350af0298b1d (diff) | |
download | mediapointer-dvb-s2-bd319f4e81f51afbe7abe0b444d016cfe70088bc.tar.gz mediapointer-dvb-s2-bd319f4e81f51afbe7abe0b444d016cfe70088bc.tar.bz2 |
Clean up long-standing video format handling mess in pvrusb2-v4l2.c
From: Mike Isely <isely@pobox.com>
Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 78cdd01c8..c82c3abad 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -450,12 +450,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, vf->fmt.pix.width = val; val = 0; pvr2_ctrl_get_value( - pvr2_hdw_get_ctrl_by_id(hdw, - PVR2_CID_INTERLACE), - &val); - if (val) vf->fmt.pix.width /= 2; - val = 0; - pvr2_ctrl_get_value( pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_VRES), &val); vf->fmt.pix.height = val; @@ -482,25 +476,22 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, case V4L2_BUF_TYPE_VIDEO_CAPTURE: { int h = vf->fmt.pix.height; int w = vf->fmt.pix.width; - int vd_std, hf, hh; - vd_std = 0; - pvr2_ctrl_get_value( - pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_STDCUR), - &vd_std); - if (vd_std & V4L2_STD_525_60) { - hf=480; - } else { - hf=576; + if (h < 200) { + h = 200; + } else if (h > 625) { + h = 625; + } + if (w < 320) { + w = 320; + } else if (w > 720) { + w = 720; } - hh = (int) (hf / 2); memcpy(vf, &pvr_format[PVR_FORMAT_PIX], sizeof(struct v4l2_format)); - if (w > 720) - vf->fmt.pix.width = 720; - vf->fmt.pix.width &= 0xff0; - vf->fmt.pix.height = (h > hh) ? hf : hh; + vf->fmt.pix.width = w; + vf->fmt.pix.height = h; if (cmd == VIDIOC_S_FMT) { pvr2_ctrl_set_value( @@ -511,10 +502,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, pvr2_hdw_get_ctrl_by_id(hdw, PVR2_CID_VRES), vf->fmt.pix.height); - pvr2_ctrl_set_value( - pvr2_hdw_get_ctrl_by_id( - hdw,PVR2_CID_INTERLACE), - vf->fmt.pix.height != hf); } } break; case V4L2_BUF_TYPE_VBI_CAPTURE: |