diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2009-05-30 17:45:46 -0700 |
---|---|---|
committer | Trent Piepho <xyzzy@speakeasy.org> | 2009-05-30 17:45:46 -0700 |
commit | 63242b556aeb302ca2feab368b784eb1e8ff2df0 (patch) | |
tree | 7e005fd135e455c668aa03c93eed350ee827eb7e /linux/drivers/media/video/mt9m001.c | |
parent | 3b017fe86fc86aebdfb6430c70d4e9f9fb944492 (diff) | |
download | mediapointer-dvb-s2-63242b556aeb302ca2feab368b784eb1e8ff2df0.tar.gz mediapointer-dvb-s2-63242b556aeb302ca2feab368b784eb1e8ff2df0.tar.bz2 |
mt9: Use v4l bounding/alignment function
From: Trent Piepho <xyzzy@speakeasy.org>
The v4l function has a better algorithm for aligning image size.
Priority: normal
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Diffstat (limited to 'linux/drivers/media/video/mt9m001.c')
-rw-r--r-- | linux/drivers/media/video/mt9m001.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/linux/drivers/media/video/mt9m001.c b/linux/drivers/media/video/mt9m001.c index 8d61ad30a..e609d68c4 100644 --- a/linux/drivers/media/video/mt9m001.c +++ b/linux/drivers/media/video/mt9m001.c @@ -280,15 +280,9 @@ static int mt9m001_try_fmt(struct soc_camera_device *icd, { struct v4l2_pix_format *pix = &f->fmt.pix; - if (pix->height < 32 + icd->y_skip_top) - pix->height = 32 + icd->y_skip_top; - if (pix->height > 1024 + icd->y_skip_top) - pix->height = 1024 + icd->y_skip_top; - if (pix->width < 48) - pix->width = 48; - if (pix->width > 1280) - pix->width = 1280; - pix->width &= ~0x01; /* has to be even, unsure why was ~3 */ + v4l_bound_align_image(&pix->width, 48, 1280, 1, + &pix->height, 32 + icd->y_skip_top, + 1024 + icd->y_skip_top, 0, 0); return 0; } |