diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-10-12 17:39:36 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2007-10-12 17:39:36 +0200 |
commit | d5a2bfaacc59815422854a9e0f0be3e07e92ebd8 (patch) | |
tree | 6e38e50b26abda1eac02df033582ec7a986f15f2 /linux/drivers | |
parent | 79e9d4b95a95f2441ae8461dbd449b8c01fd2623 (diff) | |
download | mediapointer-dvb-s2-d5a2bfaacc59815422854a9e0f0be3e07e92ebd8.tar.gz mediapointer-dvb-s2-d5a2bfaacc59815422854a9e0f0be3e07e92ebd8.tar.bz2 |
ivtv: fix resizing MPEG1 streams
From: Hans Verkuil <hverkuil@xs4all.nl>
Resizing an MPEG 1 stream would cut off the right half of the
image due to a missing divide by 2 in VIDIOC_S_FMT.
Also did some minor cleanup in this part of the code.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/video/ivtv/ivtv-ioctl.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-ioctl.c b/linux/drivers/media/video/ivtv/ivtv-ioctl.c index 10862dbb2..b01aaa752 100644 --- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c @@ -555,6 +555,7 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype, /* set window size */ if (fmt->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) { + struct cx2341x_mpeg_params *p = &itv->params; int w = fmt->fmt.pix.width; int h = fmt->fmt.pix.height; @@ -566,23 +567,25 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype, fmt->fmt.pix.width = w; fmt->fmt.pix.height = h; #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) - if (itv->params.width != 720 || itv->params.height != (itv->is_50hz ? 576 : 480)) - itv->params.video_temporal_filter = 0; + if (p->width != 720 || p->height != (itv->is_50hz ? 576 : 480)) + p->video_temporal_filter = 0; else - itv->params.video_temporal_filter = 8; + p->video_temporal_filter = 8; #endif - if (!set_fmt || (itv->params.width == w && itv->params.height == h)) + if (!set_fmt || (p->width == w && p->height == h)) return 0; if (atomic_read(&itv->capturing) > 0) return -EBUSY; - itv->params.width = w; - itv->params.height = h; + p->width = w; + p->height = h; if (w != 720 || h != (itv->is_50hz ? 576 : 480)) - itv->params.video_temporal_filter = 0; + p->video_temporal_filter = 0; else - itv->params.video_temporal_filter = 8; + p->video_temporal_filter = 8; + if (p->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1) + fmt->fmt.pix.width /= 2; itv->video_dec_func(itv, VIDIOC_S_FMT, fmt); return ivtv_get_fmt(itv, streamtype, fmt); } |