aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-06-25 19:04:16 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-26 23:17:21 -0400
commit039c430f896640f77bc073f9e8ac71018721aab0 (patch)
tree31b2f735ffc92ad434650bcbe04cde29ed46995f /drivers/media/video/pvrusb2
parent4588677121d894ec989e938129da4ae02d332b6c (diff)
V4L/DVB (4234): Clean up long-standing video format handling mess in pvrusb2-v4l2.c
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/pvrusb2')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 74b681aeda2f..e93e2aa81f30 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -434,12 +434,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
434 vf->fmt.pix.width = val; 434 vf->fmt.pix.width = val;
435 val = 0; 435 val = 0;
436 pvr2_ctrl_get_value( 436 pvr2_ctrl_get_value(
437 pvr2_hdw_get_ctrl_by_id(hdw,
438 PVR2_CID_INTERLACE),
439 &val);
440 if (val) vf->fmt.pix.width /= 2;
441 val = 0;
442 pvr2_ctrl_get_value(
443 pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_VRES), 437 pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_VRES),
444 &val); 438 &val);
445 vf->fmt.pix.height = val; 439 vf->fmt.pix.height = val;
@@ -466,25 +460,22 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
466 case V4L2_BUF_TYPE_VIDEO_CAPTURE: { 460 case V4L2_BUF_TYPE_VIDEO_CAPTURE: {
467 int h = vf->fmt.pix.height; 461 int h = vf->fmt.pix.height;
468 int w = vf->fmt.pix.width; 462 int w = vf->fmt.pix.width;
469 int vd_std, hf, hh;
470 463
471 vd_std = 0; 464 if (h < 200) {
472 pvr2_ctrl_get_value( 465 h = 200;
473 pvr2_hdw_get_ctrl_by_id(hdw,PVR2_CID_STDCUR), 466 } else if (h > 625) {
474 &vd_std); 467 h = 625;
475 if (vd_std & V4L2_STD_525_60) { 468 }
476 hf=480; 469 if (w < 320) {
477 } else { 470 w = 320;
478 hf=576; 471 } else if (w > 720) {
472 w = 720;
479 } 473 }
480 hh = (int) (hf / 2);
481 474
482 memcpy(vf, &pvr_format[PVR_FORMAT_PIX], 475 memcpy(vf, &pvr_format[PVR_FORMAT_PIX],
483 sizeof(struct v4l2_format)); 476 sizeof(struct v4l2_format));
484 if (w > 720) 477 vf->fmt.pix.width = w;
485 vf->fmt.pix.width = 720; 478 vf->fmt.pix.height = h;
486 vf->fmt.pix.width &= 0xff0;
487 vf->fmt.pix.height = (h > hh) ? hf : hh;
488 479
489 if (cmd == VIDIOC_S_FMT) { 480 if (cmd == VIDIOC_S_FMT) {
490 pvr2_ctrl_set_value( 481 pvr2_ctrl_set_value(
@@ -495,10 +486,6 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
495 pvr2_hdw_get_ctrl_by_id(hdw, 486 pvr2_hdw_get_ctrl_by_id(hdw,
496 PVR2_CID_VRES), 487 PVR2_CID_VRES),
497 vf->fmt.pix.height); 488 vf->fmt.pix.height);
498 pvr2_ctrl_set_value(
499 pvr2_hdw_get_ctrl_by_id(
500 hdw,PVR2_CID_INTERLACE),
501 vf->fmt.pix.height != hf);
502 } 489 }
503 } break; 490 } break;
504 case V4L2_BUF_TYPE_VBI_CAPTURE: 491 case V4L2_BUF_TYPE_VBI_CAPTURE: