summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-07-13 20:15:02 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-13 20:15:02 -0300
commit50d2769688b47965b7ef2a6b60eba8d80d5dc156 (patch)
treef7bc8fb88a25ba97a866a23190d65899e0fe4a01 /linux/drivers/media/video/em28xx/em28xx-video.c
parent8c6e58b4adfb075524553ae7b390f8ea7406370d (diff)
downloadmediapointer-dvb-s2-50d2769688b47965b7ef2a6b60eba8d80d5dc156.tar.gz
mediapointer-dvb-s2-50d2769688b47965b7ef2a6b60eba8d80d5dc156.tar.bz2
em28xx: fix webcam scaling
From: Mauro Carvalho Chehab <mchehab@redhat.com> While trying to fix an mt9v001 webcam, I noticed that HSCALE/VSCALE do work with em28xx + webcam. The issue is that the scaling setup depends on the number of visible rows/cols of the input image. With mt9v011 (Silvercrest), the resolution is 640x480. So, the scaling is different from a normal TV image (720x480 on NTSC). This were causing a wrong scaling and a previous patch disabled scaling. As each sensor have their different resolution setting, the xres/yres should be adjusted accordingly with the input sensor. Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-video.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c
index e447c9f0a..cef676bf8 100644
--- a/linux/drivers/media/video/em28xx/em28xx-video.c
+++ b/linux/drivers/media/video/em28xx/em28xx-video.c
@@ -679,8 +679,8 @@ static void get_scale(struct em28xx *dev,
unsigned int width, unsigned int height,
unsigned int *hscale, unsigned int *vscale)
{
- unsigned int maxw = norm_maxw(dev);
- unsigned int maxh = norm_maxh(dev);
+ unsigned int maxw = norm_maxw(dev);
+ unsigned int maxh = norm_maxh(dev);
*hscale = (((unsigned long)maxw) << 12) / width - 4096L;
if (*hscale >= 0x4000)
@@ -748,11 +748,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
return -EINVAL;
}
- if (dev->board.is_webcam) {
- /* FIXME: This is the only supported fmt */
- width = 640;
- height = 480;
- } else if (dev->board.is_em2800) {
+ if (dev->board.is_em2800) {
/* the em2800 can only scale down to 50% */
height = height > (3 * maxh / 4) ? maxh : maxh / 2;
width = width > (3 * maxw / 4) ? maxw : maxw / 2;
@@ -789,12 +785,6 @@ static int em28xx_set_video_format(struct em28xx *dev, unsigned int fourcc,
{
struct em28xx_fmt *fmt;
- /* FIXME: This is the only supported fmt */
- if (dev->board.is_webcam) {
- width = 640;
- height = 480;
- }
-
fmt = format_by_fourcc(fourcc);
if (!fmt)
return -EINVAL;