diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-30 08:36:17 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-30 08:36:17 -0300 |
commit | 331ffeac0127bface1146240b2b494272452d6bc (patch) | |
tree | 0b2b13598ae3c57b6514210ace79f03a55197fea /linux/drivers/media/video/em28xx/em28xx-video.c | |
parent | 3ba1d8073b90814e553b5a1ca1cd7a7b065c2cd4 (diff) | |
download | mediapointer-dvb-s2-331ffeac0127bface1146240b2b494272452d6bc.tar.gz mediapointer-dvb-s2-331ffeac0127bface1146240b2b494272452d6bc.tar.bz2 |
em28xx: add other video formats
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Add suppport for the teste RGB565 format (16 bits/pixel).
Currently, webcam support works only at RGB565, at 640x480.
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.c | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c index 63d21698c..b4dde89e9 100644 --- a/linux/drivers/media/video/em28xx/em28xx-video.c +++ b/linux/drivers/media/video/em28xx/em28xx-video.c @@ -94,6 +94,49 @@ static struct em28xx_fmt format[] = { .fourcc = V4L2_PIX_FMT_YUYV, .depth = 16, .reg = EM28XX_OUTFMT_YUV422_Y0UY1V, + }, { + .name = "16 bpp RGB, le", + .fourcc = V4L2_PIX_FMT_RGB565, + .depth = 16, + .reg = EM28XX_OUTFMT_YUV211, +#if 0 + /* TODO: need tests and newer definitions */ + }, { + .name = "Y1-U-Y0-V, 16 bpp", + .fourcc = 0, + .depth = 16, + .reg = EM28XX_OUTFMT_YUV422_Y1UY0V + }, { + .name = "YUV211, 8 bpp", + .fourcc = 0, + .depth = 8, + .reg = EM28XX_OUTFMT_YUV211, + }, { + .name = "YUV411, 12 bpp", + .fourcc = 0, + .depth = 12, + .reg = EM28XX_OUTFMT_YUV411, + }, { + .name = "RGB, 8bit RGRG", + .fourcc = 0, + .depth = 8, + .reg = EM28XX_OUTFMT_YUV211, + }, { + .name = "RGB, 8bit GRGR", + .fourcc = 0, + .depth = 8, + .reg = EM28XX_OUTFMT_YUV211, + }, { + .name = "RGB, 8bit GBGB", + .fourcc = 0, + .depth = 8, + .reg = EM28XX_OUTFMT_YUV211, + }, { + .name = "RGB, 8bit BGBG", + .fourcc = 0, + .depth = 8, + .reg = EM28XX_OUTFMT_RGB_8_BGBG, +#endif }, }; @@ -698,6 +741,10 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, unsigned int hscale, vscale; struct em28xx_fmt *fmt; + /* FIXME: This is the only supported fmt */ + if (dev->board.is_27xx) + f->fmt.pix.pixelformat = V4L2_PIX_FMT_RGB565; + fmt = format_by_fourcc(f->fmt.pix.pixelformat); if (!fmt) { em28xx_videodbg("Fourcc format (%08x) invalid.\n", @@ -705,7 +752,12 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, return -EINVAL; } - if (dev->board.is_em2800) { + if (dev->board.is_27xx) { + /* FIXME: This is the only supported fmt */ + width = 640; + height = 480; + V4L2_PIX_FMT_RGB565; + } else 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; @@ -751,6 +803,10 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, mutex_lock(&dev->lock); + /* FIXME: This is the only supported fmt */ + if (dev->board.is_27xx) + f->fmt.pix.pixelformat = V4L2_PIX_FMT_RGB565; + vidioc_try_fmt_vid_cap(file, priv, f); fmt = format_by_fourcc(f->fmt.pix.pixelformat); |