summaryrefslogtreecommitdiff
path: root/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
diff options
context:
space:
mode:
authorhans@localhost.localdomain <hans@localhost.localdomain>2008-07-23 14:04:23 +0200
committerhans@localhost.localdomain <hans@localhost.localdomain>2008-07-23 14:04:23 +0200
commit8ee417ab6882e4c478e95c6f0198efe416ee5da8 (patch)
tree50459eb56816ae4d4a7d31975a80c6ca0ec1b1c1 /v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
parent6b9a288b7689b76db669d5fb192a5190fcafbcc8 (diff)
downloadmediapointer-dvb-s2-8ee417ab6882e4c478e95c6f0198efe416ee5da8.tar.gz
mediapointer-dvb-s2-8ee417ab6882e4c478e95c6f0198efe416ee5da8.tar.bz2
libv4l 0.3.7 release, add spca505/6 and spca508 format support
From: Hans de Goede <j.w.r.degoede@hhs.nl> * Add spca505/6 and spca508 cam specific formats (YUYV per line variations) Signed-off-by: Hans de Goede <j.w.r.degoede@hhs.nl>
Diffstat (limited to 'v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c')
-rw-r--r--v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
index 6c6cb693d..3d61225b9 100644
--- a/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
+++ b/v4l2-apps/lib/libv4l/libv4lconvert/libv4lconvert.c
@@ -42,6 +42,8 @@ static const unsigned int supported_src_pixfmts[] = {
V4L2_PIX_FMT_SGRBG8,
V4L2_PIX_FMT_SRGGB8,
V4L2_PIX_FMT_SPCA501,
+ V4L2_PIX_FMT_SPCA505,
+ V4L2_PIX_FMT_SPCA508,
V4L2_PIX_FMT_SPCA561,
V4L2_PIX_FMT_SN9C10X,
V4L2_PIX_FMT_PAC207,
@@ -310,14 +312,37 @@ int v4lconvert_convert(struct v4lconvert_data *data,
dest_fmt->fmt.pix.height, src_fmt->fmt.pix.pixelformat);
break;
+ /* YUYV line by line formats */
case V4L2_PIX_FMT_SPCA501:
+ case V4L2_PIX_FMT_SPCA505:
+ case V4L2_PIX_FMT_SPCA508:
+ {
+ unsigned char tmpbuf[dest_fmt->fmt.pix.width * dest_fmt->fmt.pix.height *
+ 3 / 2];
+ unsigned char *my_dst = (dest_fmt->fmt.pix.pixelformat ==
+ V4L2_PIX_FMT_BGR24) ? tmpbuf : dest;
+
+ switch (src_fmt->fmt.pix.pixelformat) {
+ case V4L2_PIX_FMT_SPCA501:
+ v4lconvert_spca501_to_yuv420(src, my_dst, dest_fmt->fmt.pix.width,
+ dest_fmt->fmt.pix.height);
+ break;
+ case V4L2_PIX_FMT_SPCA505:
+ v4lconvert_spca505_to_yuv420(src, my_dst, dest_fmt->fmt.pix.width,
+ dest_fmt->fmt.pix.height);
+ break;
+ case V4L2_PIX_FMT_SPCA508:
+ v4lconvert_spca508_to_yuv420(src, my_dst, dest_fmt->fmt.pix.width,
+ dest_fmt->fmt.pix.height);
+ break;
+ }
+
if (dest_fmt->fmt.pix.pixelformat == V4L2_PIX_FMT_BGR24)
- v4lconvert_spca501_to_bgr24(src, dest, dest_fmt->fmt.pix.width,
- dest_fmt->fmt.pix.height);
- else
- v4lconvert_spca501_to_yuv420(src, dest, dest_fmt->fmt.pix.width,
- dest_fmt->fmt.pix.height);
+ v4lconvert_yuv420_to_bgr24(tmpbuf, dest, dest_fmt->fmt.pix.width,
+ dest_fmt->fmt.pix.height);
+
break;
+ }
/* compressed bayer formats */
case V4L2_PIX_FMT_SPCA561: