diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-03 02:54:18 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-07-03 02:54:18 -0300 |
commit | 5fd0c79afbb036e1e2147505dd8902716e8ed08a (patch) | |
tree | eb6c029909f19381275ecde9ca2ffdc41316e468 /linux/drivers/media/video | |
parent | 24655815f5d1643d22194d5abbd46c1bd43669e9 (diff) | |
download | mediapointer-dvb-s2-5fd0c79afbb036e1e2147505dd8902716e8ed08a.tar.gz mediapointer-dvb-s2-5fd0c79afbb036e1e2147505dd8902716e8ed08a.tar.bz2 |
em28xx: Allow its usage with other different output formats
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Discovered the bug that were limiting the output format to just RGB565.
Now, it is possible to output image at Bayer format (the original one,
as generated by Silvercrest sensor, and two others), and also on YUY.
Priority: normal
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-core.c | 1 | ||||
-rw-r--r-- | linux/drivers/media/video/em28xx/em28xx-video.c | 67 |
2 files changed, 25 insertions, 43 deletions
diff --git a/linux/drivers/media/video/em28xx/em28xx-core.c b/linux/drivers/media/video/em28xx/em28xx-core.c index 7ad8edff2..1033824bd 100644 --- a/linux/drivers/media/video/em28xx/em28xx-core.c +++ b/linux/drivers/media/video/em28xx/em28xx-core.c @@ -655,7 +655,6 @@ int em28xx_set_outfmt(struct em28xx *dev) if (dev->board.is_27xx) { vinmode = 0x0d; vinctl = 0x00; - outfmt = 0x24; } else { vinmode = 0x10; vinctl = 0x11; diff --git a/linux/drivers/media/video/em28xx/em28xx-video.c b/linux/drivers/media/video/em28xx/em28xx-video.c index 157996e5f..fff90faca 100644 --- a/linux/drivers/media/video/em28xx/em28xx-video.c +++ b/linux/drivers/media/video/em28xx/em28xx-video.c @@ -90,52 +90,52 @@ MODULE_PARM_DESC(video_debug, "enable debug messages [video]"); /* supported video standards */ static struct em28xx_fmt format[] = { { - .name = "16bpp YUY2, 4:2:2, packed", + .name = "16 bpp YUY2, 4:2:2, packed", .fourcc = V4L2_PIX_FMT_YUYV, .depth = 16, .reg = EM28XX_OUTFMT_YUV422_Y0UY1V, }, { - .name = "16 bpp RGB, le", + .name = "16 bpp RGB 565, LE", .fourcc = V4L2_PIX_FMT_RGB565, .depth = 16, - .reg = EM28XX_OUTFMT_YUV211, -#if 0 - /* TODO: need tests and newer definitions */ + .reg = EM28XX_OUTFMT_RGB_16_656, }, { - .name = "Y1-U-Y0-V, 16 bpp", - .fourcc = 0, - .depth = 16, - .reg = EM28XX_OUTFMT_YUV422_Y1UY0V + .name = "8 bpp Bayer BGBG..GRGR", + .fourcc = V4L2_PIX_FMT_SBGGR8, + .depth = 8, + .reg = EM28XX_OUTFMT_RGB_8_BGBG, }, { - .name = "YUV211, 8 bpp", - .fourcc = 0, + .name = "8 bpp Bayer GRGR..BGBG", + .fourcc = V4L2_PIX_FMT_SGRBG8, .depth = 8, - .reg = EM28XX_OUTFMT_YUV211, + .reg = EM28XX_OUTFMT_RGB_8_GRGR, }, { - .name = "YUV411, 12 bpp", - .fourcc = 0, + .name = "8 bpp Bayer GBGB..RGRG", + .fourcc = V4L2_PIX_FMT_SGBRG8, + .depth = 8, + .reg = EM28XX_OUTFMT_RGB_8_GBGB, + }, { + .name = "12 bpp YUV411", + .fourcc = V4L2_PIX_FMT_YUV411P, .depth = 12, .reg = EM28XX_OUTFMT_YUV411, +#if 0 + /* TODO: Those formats need test and fourcc entries */ }, { - .name = "RGB, 8bit RGRG", + .name = "Bayer, 8bit RGRG..GBGB", .fourcc = 0, .depth = 8, - .reg = EM28XX_OUTFMT_YUV211, + .reg = EM28XX_OUTFMT_RGB_8_GBGB, }, { - .name = "RGB, 8bit GRGR", + .name = "Y1-U-Y0-V, 16 bpp", .fourcc = 0, - .depth = 8, - .reg = EM28XX_OUTFMT_YUV211, + .depth = 16, + .reg = EM28XX_OUTFMT_YUV422_Y1UY0V }, { - .name = "RGB, 8bit GBGB", + .name = "YUV211, 8 bpp", .fourcc = 0, .depth = 8, .reg = EM28XX_OUTFMT_YUV211, - }, { - .name = "RGB, 8bit BGBG", - .fourcc = 0, - .depth = 8, - .reg = EM28XX_OUTFMT_RGB_8_BGBG, #endif }, }; @@ -741,10 +741,6 @@ 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", @@ -795,7 +791,6 @@ static int em28xx_set_video_format(struct em28xx *dev, unsigned int fourcc, /* FIXME: This is the only supported fmt */ if (dev->board.is_27xx) { - fourcc = V4L2_PIX_FMT_RGB565; width = 640; height = 480; } @@ -1444,18 +1439,6 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv, if (unlikely(f->index >= ARRAY_SIZE(format))) return -EINVAL; - if (dev->board.is_27xx) { - struct em28xx_fmt *fmt; - if (f->index) - return -EINVAL; - - f->pixelformat = V4L2_PIX_FMT_RGB565; - fmt = format_by_fourcc(f->pixelformat); - strlcpy(f->description, fmt->name, sizeof(f->description)); - - return 0; - } - strlcpy(f->description, format[f->index].name, sizeof(f->description)); f->pixelformat = format[f->index].fourcc; |