aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-06-30 07:36:17 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-07-05 13:30:05 -0400
commit43cb9fe3291bb96390c1d188eb61c2d1581bb61e (patch)
treebd4f77677d348bc57d0531e863566072820b427d /drivers/media
parent02e7804b2135ff941b8846f5820cf48fbfdadd54 (diff)
V4L/DVB (12139): em28xx: add other video formats
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 'drivers/media')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 8fe1beecfffa..b96a138d9d03 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -94,6 +94,11 @@ static struct em28xx_fmt format[] = {
94 .fourcc = V4L2_PIX_FMT_YUYV, 94 .fourcc = V4L2_PIX_FMT_YUYV,
95 .depth = 16, 95 .depth = 16,
96 .reg = EM28XX_OUTFMT_YUV422_Y0UY1V, 96 .reg = EM28XX_OUTFMT_YUV422_Y0UY1V,
97 }, {
98 .name = "16 bpp RGB, le",
99 .fourcc = V4L2_PIX_FMT_RGB565,
100 .depth = 16,
101 .reg = EM28XX_OUTFMT_YUV211,
97 }, 102 },
98}; 103};
99 104
@@ -694,6 +699,10 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
694 unsigned int hscale, vscale; 699 unsigned int hscale, vscale;
695 struct em28xx_fmt *fmt; 700 struct em28xx_fmt *fmt;
696 701
702 /* FIXME: This is the only supported fmt */
703 if (dev->board.is_27xx)
704 f->fmt.pix.pixelformat = V4L2_PIX_FMT_RGB565;
705
697 fmt = format_by_fourcc(f->fmt.pix.pixelformat); 706 fmt = format_by_fourcc(f->fmt.pix.pixelformat);
698 if (!fmt) { 707 if (!fmt) {
699 em28xx_videodbg("Fourcc format (%08x) invalid.\n", 708 em28xx_videodbg("Fourcc format (%08x) invalid.\n",
@@ -701,7 +710,11 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
701 return -EINVAL; 710 return -EINVAL;
702 } 711 }
703 712
704 if (dev->board.is_em2800) { 713 if (dev->board.is_27xx) {
714 /* FIXME: This is the only supported fmt */
715 width = 640;
716 height = 480;
717 } else if (dev->board.is_em2800) {
705 /* the em2800 can only scale down to 50% */ 718 /* the em2800 can only scale down to 50% */
706 height = height > (3 * maxh / 4) ? maxh : maxh / 2; 719 height = height > (3 * maxh / 4) ? maxh : maxh / 2;
707 width = width > (3 * maxw / 4) ? maxw : maxw / 2; 720 width = width > (3 * maxw / 4) ? maxw : maxw / 2;
@@ -747,6 +760,10 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
747 760
748 mutex_lock(&dev->lock); 761 mutex_lock(&dev->lock);
749 762
763 /* FIXME: This is the only supported fmt */
764 if (dev->board.is_27xx)
765 f->fmt.pix.pixelformat = V4L2_PIX_FMT_RGB565;
766
750 vidioc_try_fmt_vid_cap(file, priv, f); 767 vidioc_try_fmt_vid_cap(file, priv, f);
751 768
752 fmt = format_by_fourcc(f->fmt.pix.pixelformat); 769 fmt = format_by_fourcc(f->fmt.pix.pixelformat);