Web lists-archives.com

[Spca50x-devs] PATCH: some gspcav2 fixes




<lala lots of explanation no patch attached, oops>

Hi Jean-Francois,

While preparing clean patches for the removal of some came specific format
decoding I noticed that I have forgotten to submit one important bugfix.

With gspcav2-2.0.4 S_FMT will return the internal format number instead of 0
(for success) when the format does not need changing.

This patch also adds SPCA501 and SPCA561 pixelformats as preperation for my
next patches.

Regards,

Hans

diff -ur gspcav2-2.0.4/gspca.c gspcav2-2.0.4.new/gspca.c
--- gspcav2-2.0.4/gspca.c	2008-06-27 10:35:53.000000000 +0200
+++ gspcav2-2.0.4.new/gspca.c	2008-06-30 20:25:09.000000000 +0200
@@ -659,6 +659,7 @@
 	switch (format) {
 	case V4L2_PIX_FMT_MJPEG:
 	case V4L2_PIX_FMT_JPEG:
+	case V4L2_PIX_FMT_SPCA561:
 		return 1;
 	}
 	return 0;
@@ -712,9 +713,11 @@
 	case V4L2_PIX_FMT_YYUV:		/* 'YYUV' */
 		return 16;
 	case V4L2_PIX_FMT_YUV420:	/* 'YU12' planar 4.2.0 */
+	case V4L2_PIX_FMT_SPCA501:
 		return 12;
 	case V4L2_PIX_FMT_MJPEG:
 	case V4L2_PIX_FMT_JPEG:
+	case V4L2_PIX_FMT_SPCA561:
 	case V4L2_PIX_FMT_SBGGR8:	/* 'BA81' Bayer */
 	case V4L2_PIX_FMT_SGBRG8:	/* 'GBRG' Bayer */
 		return 8;
@@ -1378,12 +1381,16 @@
 	}
 
 #ifndef GSPCA_HLP
-	if (ret == gspca_dev->curr_mode)
+	if (ret == gspca_dev->curr_mode) {
+		ret = 0;
 		goto out;			/* same mode */
+	}
 #else /*GSPCA_HLP*/
 	if (ret == gspca_dev->curr_mode
-	    && gspca_dev->pixfmt == fmt->fmt.pix.pixelformat)
+	    && gspca_dev->pixfmt == fmt->fmt.pix.pixelformat) {
+		ret = 0;
 		goto out;			/* same mode */
+	}
 #endif /*GSPCA_HLP*/
 
 	if (gspca_dev->streaming) {
Only in gspcav2-2.0.4.new/: gspca.c~
diff -ur gspcav2-2.0.4/gspca.h gspcav2-2.0.4.new/gspca.h
--- gspcav2-2.0.4/gspca.h	2008-06-27 09:30:33.000000000 +0200
+++ gspcav2-2.0.4.new/gspca.h	2008-06-30 20:26:11.000000000 +0200
@@ -9,6 +9,14 @@
 #include <media/v4l2-common.h>
 #include <linux/mutex.h>
 
+#ifndef V4L2_PIX_FMT_SPCA501
+#define V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S','5','0','1')
+#endif
+
+#ifndef V4L2_PIX_FMT_SPCA561
+#define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S','5','6','1')
+#endif
+
 #ifndef V4L2_PIX_FMT_SGBRG8
 #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G','B','R','G')
 #endif
Only in gspcav2-2.0.4.new/: gspca.h~
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Spca50x-devs mailing list
Spca50x-devs@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/spca50x-devs