summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx.h
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-07-14 01:15:02 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-24 19:03:24 +0200
commit5569996421fa1cfc1fc0d9e683ac1def46ea985d (patch)
tree552bf2fc87952018f5af8ae3653c535e599ffe90 /drivers/media/video/em28xx/em28xx.h
parentV4L/DVB (12238): em28xx: call sensor detection code for all webcam entries (diff)
downloadlinux-5569996421fa1cfc1fc0d9e683ac1def46ea985d.tar.xz
linux-5569996421fa1cfc1fc0d9e683ac1def46ea985d.zip
V4L/DVB (12239): em28xx: fix webcam scaling
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. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx.h')
-rw-r--r--drivers/media/video/em28xx/em28xx.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h
index 655dd78cc07b..71444ddbe40c 100644
--- a/drivers/media/video/em28xx/em28xx.h
+++ b/drivers/media/video/em28xx/em28xx.h
@@ -479,6 +479,7 @@ struct em28xx {
struct em28xx_board board;
enum em28xx_sensor em28xx_sensor;
+ int sensor_xres, sensor_yres;
unsigned int stream_on:1; /* Locks streams */
unsigned int has_audio_class:1;
@@ -760,17 +761,23 @@ static inline int em28xx_gamma_set(struct em28xx *dev, s32 val)
/*FIXME: maxw should be dependent of alt mode */
static inline unsigned int norm_maxw(struct em28xx *dev)
{
+ if (dev->board.is_webcam)
+ return dev->sensor_xres;
+
if (dev->board.max_range_640_480)
return 640;
- else
- return 720;
+
+ return 720;
}
static inline unsigned int norm_maxh(struct em28xx *dev)
{
+ if (dev->board.is_webcam)
+ return dev->sensor_yres;
+
if (dev->board.max_range_640_480)
return 480;
- else
- return (dev->norm & V4L2_STD_625_50) ? 576 : 480;
+
+ return (dev->norm & V4L2_STD_625_50) ? 576 : 480;
}
#endif