On 8 January 2009 00:06:11 GWater wrote:
> Vasily Khoruzhick schrieb:
> > On 7 January 2009 23:43:40 GWater wrote:
> >> Vasily Khoruzhick schrieb:
> >>> Please test it, and if it works, I'll mail this patch to Hans de Goede
> >>>
> >>> Regards
> >>> Vasily
> >>
> >> Where can I get a copy of that git repo?
> >>
> >> GWater
> >
> > Errr, it's not git repo, I've just used git to track changes I made :)
> > Patch applies nicely over libv4l-0.5.7
>
> I'm sorry but it doesn't.  Even git can't process it.
>
> (I did this:
> $ tar -xzf ...
> $ cd libv4l...
> $ git init
> $ git add .
> $ git commit
> $ git am ../patchfile
> )
>
> GWater

My fault,
this one should work:

From 14d8c6288df2288cd71fe55d5ed49b0023c4e475 Mon Sep 17 00:00:00 2001
From: Vasily Khoruzhick <[email protected]>
Date: Thu, 8 Jan 2009 00:18:06 +0200
Subject: [PATCH] Added sn9c20x i420 decoder


Signed-off-by: Vasily Khoruzhick <[email protected]>
---
 libv4lconvert/Makefile             |    2 +-
 libv4lconvert/libv4lconvert-priv.h |    7 +++++++
 libv4lconvert/libv4lconvert.c      |    5 +++++
 3 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/libv4lconvert/Makefile b/libv4lconvert/Makefile
index 65748bb..011949b 100644
--- a/libv4lconvert/Makefile
+++ b/libv4lconvert/Makefile
@@ -10,7 +10,7 @@ CONVERT_LIB   = libv4lconvert.so
 override CPPFLAGS += -fPIC
 endif
 
-CONVERT_OBJS  = libv4lconvert.o tinyjpeg.o sn9c10x.o pac207.o flip.o crop.o \
+CONVERT_OBJS  = libv4lconvert.o tinyjpeg.o sn9c10x.o sn9c20x.o pac207.o flip.o crop.o \
 		jidctflt.o spca561-decompress.o rgbyuv.o spca501.o bayer.o
 TARGETS       = $(CONVERT_LIB) libv4lconvert.pc
 INCLUDES      = ../include/libv4lconvert.h
diff --git a/libv4lconvert/libv4lconvert-priv.h b/libv4lconvert/libv4lconvert-priv.h
index 55a5b49..f34036d 100644
--- a/libv4lconvert/libv4lconvert-priv.h
+++ b/libv4lconvert/libv4lconvert-priv.h
@@ -63,6 +63,10 @@
 #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U')
 #endif
 
+#ifndef V4L2_PIX_FMT_SN9C20X_I420
+#define V4L2_PIX_FMT_SN9C20X_I420  v4l2_fourcc('S', '9', '2', '0')
+#endif
+
 #define V4LCONVERT_ERROR_MSG_SIZE 256
 #define V4LCONVERT_MAX_FRAMESIZES 16
 
@@ -147,6 +151,9 @@ void v4lconvert_spca505_to_yuv420(const unsigned char *src, unsigned char *dst,
 void v4lconvert_spca508_to_yuv420(const unsigned char *src, unsigned char *dst,
   int width, int height, int yvu);
 
+void v4lconvert_sn9c20x_to_yuv420(const unsigned char *src, unsigned char *dst,
+  int width, int height, int yvu);
+
 void v4lconvert_decode_spca561(const unsigned char *src, unsigned char *dst,
   int width, int height);
 
diff --git a/libv4lconvert/libv4lconvert.c b/libv4lconvert/libv4lconvert.c
index b3487b6..e123d7b 100644
--- a/libv4lconvert/libv4lconvert.c
+++ b/libv4lconvert/libv4lconvert.c
@@ -44,6 +44,7 @@ static const struct v4lconvert_pixfmt supported_src_pixfmts[] = {
   SUPPORTED_DST_PIXFMTS,
   { V4L2_PIX_FMT_YUYV,    0 },
   { V4L2_PIX_FMT_YVYU,    0 },
+  { V4L2_PIX_FMT_SN9C20X_I420, 0 },
   { V4L2_PIX_FMT_SBGGR8,  0 },
   { V4L2_PIX_FMT_SGBRG8,  0 },
   { V4L2_PIX_FMT_SGRBG8,  0 },
@@ -538,6 +539,7 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data,
     case V4L2_PIX_FMT_SPCA501:
     case V4L2_PIX_FMT_SPCA505:
     case V4L2_PIX_FMT_SPCA508:
+    case V4L2_PIX_FMT_SN9C20X_I420:
     {
       unsigned char *d;
       int yvu = 0;
@@ -564,6 +566,9 @@ static int v4lconvert_convert_pixfmt(struct v4lconvert_data *data,
 	case V4L2_PIX_FMT_SPCA508:
 	  v4lconvert_spca508_to_yuv420(src, d, width, height, yvu);
 	  break;
+	case V4L2_PIX_FMT_SN9C20X_I420:
+	  v4lconvert_sn9c20x_to_yuv420(src, d, width, height, yvu);
+	  break;
       }
 
       switch (dest_pix_fmt) {
-- 
1.6.0.6

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to