Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 30833
b: refs/heads/master
c: 039c430
h: refs/heads/master
i:
  30831: 690ad7a
v: v3
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Jun 27, 2006
1 parent d05a9ee commit 0cb5aed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 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: 4588677121d894ec989e938129da4ae02d332b6c
refs/heads/master: 039c430f896640f77bc073f9e8ac71018721aab0
35 changes: 11 additions & 24 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
&val);
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);
Expand Down Expand Up @@ -466,25 +460,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(
Expand All @@ -495,10 +486,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:
Expand Down

0 comments on commit 0cb5aed

Please sign in to comment.