Commit 039c430f authored by Mike Isely's avatar Mike Isely Committed by Mauro Carvalho Chehab

V4L/DVB (4234): Clean up long-standing video format handling mess in pvrusb2-v4l2.c

Signed-off-by: default avatarMike Isely <isely@pobox.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 45886771
...@@ -433,12 +433,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, ...@@ -433,12 +433,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
&val); &val);
vf->fmt.pix.width = val; vf->fmt.pix.width = val;
val = 0; 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_ctrl_get_value(
pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_VRES), pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_VRES),
&val); &val);
...@@ -466,25 +460,22 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, ...@@ -466,25 +460,22 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
case V4L2_BUF_TYPE_VIDEO_CAPTURE: { case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
int h = vf->fmt.pix.height; int h = vf->fmt.pix.height;
int w = vf->fmt.pix.width; int w = vf->fmt.pix.width;
int vd_std, hf, hh;
vd_std = 0; if (h < 200) {
pvr2_ctrl_get_value( h = 200;
pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_STDCUR), } else if (h > 625) {
&vd_std); h = 625;
if (vd_std & V4L2_STD_525_60) { }
hf=480; if (w < 320) {
} else { w = 320;
hf=576; } else if (w > 720) {
w = 720;
} }
hh = (int) (hf / 2);
memcpy(vf, &pvr_format[PVR_FORMAT_PIX], memcpy(vf, &pvr_format[PVR_FORMAT_PIX],
sizeof(struct v4l2_format)); sizeof(struct v4l2_format));
if (w > 720) vf->fmt.pix.width = w;
vf->fmt.pix.width = 720; vf->fmt.pix.height = h;
vf->fmt.pix.width &= 0xff0;
vf->fmt.pix.height = (h > hh) ? hf : hh;
if (cmd == VIDIOC_S_FMT) { if (cmd == VIDIOC_S_FMT) {
pvr2_ctrl_set_value( pvr2_ctrl_set_value(
...@@ -495,10 +486,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file, ...@@ -495,10 +486,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
pvr2_hdw_get_ctrl_by_id(hdw, pvr2_hdw_get_ctrl_by_id(hdw,
PVR2_CID_VRES), PVR2_CID_VRES),
vf->fmt.pix.height); vf->fmt.pix.height);
pvr2_ctrl_set_value(
pvr2_hdw_get_ctrl_by_id(
hdw,PVR2_CID_INTERLACE),
vf->fmt.pix.height != hf);
} }
} break; } break;
case V4L2_BUF_TYPE_VBI_CAPTURE: case V4L2_BUF_TYPE_VBI_CAPTURE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment