diff -Nru v4l-utils-0.8.5/ChangeLog v4l-utils-0.8.6/ChangeLog --- v4l-utils-0.8.5/ChangeLog 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/ChangeLog 2012-02-10 19:58:53.000000000 +0000 @@ -1,3 +1,15 @@ +v4l-utils-0.8.6 +--------------- +* libv4l changes (0.9.x backports) + * Add support for libjpeg >= v7 + * Add new matching algorithm for upside down table (gjasny) + * Add some more laptop models to the upside down devices table (hdegoede, gjasny) + * Retry with another frame on JPEG header decode errors (hdegoede) + * Improved JL2005BCD support (Theodore Kilgore, hdegoede) + * Set errno to EIO if getting 4 consecutive EAGAIN convert errors (hdegoede) + * Make software autowhitebalance converge faster (hdegoede) + * Add quirk support for forced tinyjpeg fallback (hdegoede) + v4l-utils-0.8.5 --------------- * Utils changes diff -Nru v4l-utils-0.8.5/debian/changelog v4l-utils-0.8.6/debian/changelog --- v4l-utils-0.8.5/debian/changelog 2011-11-14 14:48:36.000000000 +0000 +++ v4l-utils-0.8.6/debian/changelog 2012-02-19 21:07:29.000000000 +0000 @@ -1,9 +1,29 @@ -v4l-utils (0.8.5-6ubuntu1) precise; urgency=low +v4l-utils (0.8.6-1ubuntu1) precise; urgency=low * Merge with Debian unstable. Remaining Ubuntu changes: - Stop building the lib32* packages on amd64. (LP #808064) - -- Gregor Jasny Mon, 14 Nov 2011 11:26:10 +0100 + -- Gregor Jasny Sun, 19 Feb 2012 22:06:11 +0100 + +v4l-utils (0.8.6-1) unstable; urgency=low + + * Imported Upstream version 0.8.6 + - Add support for libjpeg >= v7 + - Add new matching algorithm for upside down table (Closes: #639231) + - Add some more laptop models to the upside down devices table + - Retry with another frame on JPEG header decode errors + - Improved JL2005BCD support + - Set errno to EIO if getting 4 consecutive EAGAIN convert errors + - Make software autowhitebalance converge faster + - Add quirk support for forced tinyjpeg fallback + + -- Gregor Jasny Fri, 10 Feb 2012 21:25:42 +0100 + +v4l-utils (0.8.5-7) unstable; urgency=low + + * Add 90 degrees rotated JPEG quirk for 145f:013c + + -- Gregor Jasny Sat, 31 Dec 2011 16:30:32 +0100 v4l-utils (0.8.5-6) unstable; urgency=low diff -Nru v4l-utils-0.8.5/debian/control v4l-utils-0.8.6/debian/control --- v4l-utils-0.8.5/debian/control 2011-11-14 14:48:52.000000000 +0000 +++ v4l-utils-0.8.6/debian/control 2012-02-19 21:03:05.000000000 +0000 @@ -1,14 +1,14 @@ Source: v4l-utils Section: video Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Gregor Jasny +Maintainer: Gregor Jasny Uploaders: Martin Pitt , Loic Minier DM-Upload-Allowed: yes Build-Depends: debhelper (>= 8.1.3), libjpeg-dev, - libqt4-dev [linux-any] + libqt4-dev [linux-any], + gcc-multilib [amd64] Standards-Version: 3.9.2 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/libv4l.git Vcs-Git: git://git.debian.org/git/collab-maint/libv4l.git diff -Nru v4l-utils-0.8.5/debian/lib32v4l-0.install v4l-utils-0.8.6/debian/lib32v4l-0.install --- v4l-utils-0.8.5/debian/lib32v4l-0.install 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/lib32v4l-0.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -usr/lib32/lib*.so.* -usr/lib32/libv4l/*.so -usr/lib32/libv4l/ov511-decomp -usr/lib32/libv4l/ov518-decomp - diff -Nru v4l-utils-0.8.5/debian/lib32v4l-0.links v4l-utils-0.8.6/debian/lib32v4l-0.links --- v4l-utils-0.8.5/debian/lib32v4l-0.links 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/lib32v4l-0.links 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/share/doc/libv4l-0 /usr/share/doc/lib32v4l-0 diff -Nru v4l-utils-0.8.5/debian/lib32v4l-0.symbols v4l-utils-0.8.6/debian/lib32v4l-0.symbols --- v4l-utils-0.8.5/debian/lib32v4l-0.symbols 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/lib32v4l-0.symbols 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -libv4l1.so.0 lib32v4l-0 #MINVER# - v4l1_close@Base 0.5.0 - v4l1_dup@Base 0.5.0 - v4l1_ioctl@Base 0.5.0 - v4l1_mmap@Base 0.5.0 - v4l1_munmap@Base 0.5.0 - v4l1_open@Base 0.5.0 - v4l1_read@Base 0.5.0 -libv4l2.so.0 lib32v4l-0 #MINVER# - v4l2_close@Base 0.5.0 - v4l2_dup@Base 0.5.0 - v4l2_fd_open@Base 0.5.0 - v4l2_get_control@Base 0.5.0 - v4l2_ioctl@Base 0.5.0 - v4l2_log_file@Base 0.5.0 - v4l2_mmap@Base 0.5.0 - v4l2_munmap@Base 0.5.0 - v4l2_open@Base 0.5.0 - v4l2_read@Base 0.5.0 - v4l2_set_control@Base 0.5.0 -libv4lconvert.so.0 lib32v4l-0 #MINVER# - v4lconvert_convert@Base 0.5.0 - v4lconvert_create@Base 0.5.0 - v4lconvert_destroy@Base 0.5.0 - v4lconvert_enum_fmt@Base 0.5.0 - v4lconvert_enum_frameintervals@Base 0.5.0 - v4lconvert_enum_framesizes@Base 0.5.0 - v4lconvert_get_error_message@Base 0.5.0 - v4lconvert_get_fps@Base 0.8.4 - v4lconvert_needs_conversion@Base 0.5.0 - v4lconvert_set_fps@Base 0.8.4 - v4lconvert_supported_dst_fmt_only@Base 0.5.97 - v4lconvert_supported_dst_format@Base 0.5.97 - v4lconvert_try_format@Base 0.5.0 - v4lconvert_vidioc_g_ctrl@Base 0.5.97 - v4lconvert_vidioc_queryctrl@Base 0.5.97 - v4lconvert_vidioc_s_ctrl@Base 0.5.97 diff -Nru v4l-utils-0.8.5/debian/lib32v4l-dev.install v4l-utils-0.8.6/debian/lib32v4l-dev.install --- v4l-utils-0.8.5/debian/lib32v4l-dev.install 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/lib32v4l-dev.install 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -usr/lib32/lib*.so -usr/lib32/pkgconfig/* diff -Nru v4l-utils-0.8.5/debian/lib32v4l-dev.links v4l-utils-0.8.6/debian/lib32v4l-dev.links --- v4l-utils-0.8.5/debian/lib32v4l-dev.links 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/lib32v4l-dev.links 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/share/doc/libv4l-dev /usr/share/doc/lib32v4l-dev diff -Nru v4l-utils-0.8.5/debian/patches/allow-disabling-libjpeg.diff v4l-utils-0.8.6/debian/patches/allow-disabling-libjpeg.diff --- v4l-utils-0.8.5/debian/patches/allow-disabling-libjpeg.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/allow-disabling-libjpeg.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,125 +0,0 @@ -Description: Allow to disable the libjpeg dependency (needed for cross compiled 32bit packages) -Author: Gregor Jasny -Forwarded: not-needed - ---- a/lib/libv4lconvert/Makefile -+++ b/lib/libv4lconvert/Makefile -@@ -1,6 +1,6 @@ - override CPPFLAGS += -I../include -fvisibility=hidden - --LIBS_libv4lconvert = -lrt -lm -ljpeg -+LIBS_libv4lconvert = -lrt -lm - - ifeq ($(LINKTYPE),static) - CONVERT_LIB = libv4lconvert.a -@@ -12,13 +12,20 @@ - CONVERT_OBJS = libv4lconvert.o tinyjpeg.o sn9c10x.o sn9c20x.o pac207.o \ - mr97310a.o flip.o crop.o jidctflt.o spca561-decompress.o \ - rgbyuv.o sn9c2028-decomp.o spca501.o sq905c.o bayer.o hm12.o \ -- stv0680.o cpia1.o se401.o jpgl.o jpeg.o jpeg_memsrcdest.o \ -+ stv0680.o cpia1.o se401.o jpgl.o jpeg.o \ - control/libv4lcontrol.o processing/libv4lprocessing.o \ - processing/whitebalance.o processing/autogain.o \ - processing/gamma.o helper.o - TARGETS = $(CONVERT_LIB) libv4lconvert.pc ov511-decomp ov518-decomp - INCLUDES = ../include/libv4lconvert.h - -+ifeq ($(DISABLE_LIBJPEG),1) -+override CFLAGS += -DDISABLE_LIBJPEG -+else -+LIBS_libv4lconvert += -ljpeg -+CONVERT_OBJS += jpeg_memsrcdest.o -+endif -+ - override CPPFLAGS += -DLIBDIR=\"$(LIBDIR)\" -DLIBSUBDIR=\"$(LIBSUBDIR)\" - - all: $(TARGETS) ---- a/lib/libv4lconvert/jpeg.c -+++ b/lib/libv4lconvert/jpeg.c -@@ -19,7 +19,9 @@ - #include - #include - #include "libv4lconvert-priv.h" -+#ifndef DISABLE_LIBJPEG - #include "jpeg_memsrcdest.h" -+#endif - - int v4lconvert_decode_jpeg_tinyjpeg(struct v4lconvert_data *data, - unsigned char *src, int src_size, unsigned char *dest, -@@ -107,6 +109,8 @@ - return 0; - } - -+#ifndef DISABLE_LIBJPEG -+ - static void jerr_error_exit(j_common_ptr cinfo) - { - struct v4lconvert_data *data = cinfo->client_data; -@@ -404,3 +408,6 @@ - - return result; - } -+ -+#endif -+ ---- a/lib/libv4lconvert/libv4lconvert-priv.h -+++ b/lib/libv4lconvert/libv4lconvert-priv.h -@@ -22,7 +22,9 @@ - #include - #include - #include -+#ifndef DISABLE_LIBJPEG - #include -+#endif - #include - #include "libv4lconvert.h" - #include "control/libv4lcontrol.h" -@@ -50,11 +52,13 @@ - int64_t supported_src_formats; /* bitfield */ - char error_msg[V4LCONVERT_ERROR_MSG_SIZE]; - struct jdec_private *tinyjpeg; -+#ifndef DISABLE_LIBJPEG - struct jpeg_error_mgr jerr; - int jerr_errno; - jmp_buf jerr_jmp_state; - struct jpeg_decompress_struct cinfo; - int cinfo_initialized; -+#endif - struct v4l2_frmsizeenum framesizes[V4LCONVERT_MAX_FRAMESIZES]; - unsigned int no_framesizes; - int bandwidth; ---- a/lib/libv4lconvert/libv4lconvert.c -+++ b/lib/libv4lconvert/libv4lconvert.c -@@ -185,8 +185,10 @@ - tinyjpeg_set_components(data->tinyjpeg, comps, 3); - tinyjpeg_free(data->tinyjpeg); - } -+#ifndef DISABLE_LIBJPEG - if (data->cinfo_initialized) - jpeg_destroy_decompress(&data->cinfo); -+#endif - v4lconvert_helper_cleanup(data); - free(data->convert1_buf); - free(data->convert2_buf); -@@ -632,10 +634,13 @@ - /* JPG and variants */ - case V4L2_PIX_FMT_MJPEG: - case V4L2_PIX_FMT_JPEG: -+#ifndef DISABLE_LIBJPEG - if (data->flags & V4LCONVERT_USE_TINYJPEG) { -+#endif - result = v4lconvert_decode_jpeg_tinyjpeg(data, - src, src_size, dest, - fmt, dest_pix_fmt, 0); -+#ifndef DISABLE_LIBJPEG - } else { - result = v4lconvert_decode_jpeg_libjpeg(data, - src, src_size, dest, -@@ -650,6 +655,7 @@ - fmt, dest_pix_fmt, 0); - } - } -+#endif - break; - case V4L2_PIX_FMT_PJPG: - result = v4lconvert_decode_jpeg_tinyjpeg(data, src, src_size, diff -Nru v4l-utils-0.8.5/debian/patches/disable_fancy_upsampling.diff v4l-utils-0.8.6/debian/patches/disable_fancy_upsampling.diff --- v4l-utils-0.8.5/debian/patches/disable_fancy_upsampling.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/disable_fancy_upsampling.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -From: Gregor Jasny -Subject: Disable fancy upsampling (needed for libjpeg >= 7) -Bug-Debian: http://bugs.debian.org/647273 -Forwarded: yes - -Libv4lconvert expects to receive downsampled data. With -jpeglib 7 the default changed to TRUE. So we have to -explicitely request downsampled data after reading the -JPEG header. -Thanks to Guido Vollbeding for pointing this out. - -Signed-off-by: Gregor Jasny - ---- a/lib/libv4lconvert/jpeg.c -+++ b/lib/libv4lconvert/jpeg.c -@@ -390,6 +390,7 @@ - } - - data->cinfo.raw_data_out = TRUE; -+ data->cinfo.do_fancy_upsampling = FALSE; - jpeg_start_decompress(&data->cinfo); - /* Make libjpeg errors report that we've got some data */ - data->jerr_errno = EPIPE; diff -Nru v4l-utils-0.8.5/debian/patches/fix_spelling_error.diff v4l-utils-0.8.6/debian/patches/fix_spelling_error.diff --- v4l-utils-0.8.5/debian/patches/fix_spelling_error.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/fix_spelling_error.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -Description: Fix spelling error in manpage -Author: Gregor Jasny -Forwarded: yes - ---- a/utils/keytable/ir-keytable.1 -+++ b/utils/keytable/ir-keytable.1 -@@ -11,7 +11,7 @@ - .B ir\-keytable - [\fIOPTION\fR]... [\fIfor using the rc0 sysdev\fR] - .SH DESCRIPTION --ir\-keytable is a tool that lists the Remote Controller devices, allows to -+ir\-keytable is a tool that lists the Remote Controller devices, allows one to - get/set IR keycode/scancode tables, test events generated by IR, and to - adjust other Remote Controller options. - .PP diff -Nru v4l-utils-0.8.5/debian/patches/force_tinyjpeg_quirk.diff v4l-utils-0.8.6/debian/patches/force_tinyjpeg_quirk.diff --- v4l-utils-0.8.5/debian/patches/force_tinyjpeg_quirk.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/force_tinyjpeg_quirk.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,58 +0,0 @@ -Origin: upstream, 7eb5fdd4536019ac8afe50a23e96d9e56aa9c82d -From: Hans de Goede -Date: Tue, 2 Aug 2011 13:30:23 +0200 -Subject: [PATCH] libv4l: Add a force tinyjpeg quirk for w996Xcf based cams - -These cams produce non standard JPEG data which our embedded tinyjpeg -copy has been patched to handle, but regular libjpeg cannot handle, -so force the use of our embedded tinyjpeg for these cams. - -Signed-off-by: Hans de Goede ---- - lib/libv4lconvert/control/libv4lcontrol.c | 3 +++ - lib/libv4lconvert/control/libv4lcontrol.h | 1 + - lib/libv4lconvert/libv4lconvert.c | 4 +++- - 3 files changed, 7 insertions(+), 1 deletions(-) - -Index: libv4l/lib/libv4lconvert/control/libv4lcontrol.c -=================================================================== ---- libv4l.orig/lib/libv4lconvert/control/libv4lcontrol.c 2011-08-05 14:35:43.592828552 +0200 -+++ libv4l/lib/libv4lconvert/control/libv4lcontrol.c 2011-08-05 14:42:25.716824717 +0200 -@@ -633,6 +633,9 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_WANTS_WB_AUTOGAIN }, - { 0x047d, 0x5003, 0, NULL, NULL, - V4LCONTROL_HFLIPPED | V4LCONTROL_WANTS_WB_AUTOGAIN }, -+ /* W996xCF based cams, must use jpeglite because of funky JPEG fmt */ -+ { 0x041e, 0x4003, 0, NULL, NULL, V4LCONTROL_FORCE_TINYJPEG }, -+ { 0x1046, 0x9967, 0, NULL, NULL, V4LCONTROL_FORCE_TINYJPEG }, - }; - - static const struct v4l2_queryctrl fake_controls[]; -Index: libv4l/lib/libv4lconvert/control/libv4lcontrol.h -=================================================================== ---- libv4l.orig/lib/libv4lconvert/control/libv4lcontrol.h 2011-07-16 15:30:42.772000002 +0200 -+++ libv4l/lib/libv4lconvert/control/libv4lcontrol.h 2011-08-05 14:42:25.716824717 +0200 -@@ -28,6 +28,7 @@ - #define V4LCONTROL_ROTATED_90_JPEG 0x04 - #define V4LCONTROL_WANTS_WB 0x08 - #define V4LCONTROL_WANTS_AUTOGAIN 0x10 -+#define V4LCONTROL_FORCE_TINYJPEG 0x20 - - /* Masks */ - #define V4LCONTROL_WANTS_WB_AUTOGAIN (V4LCONTROL_WANTS_WB | V4LCONTROL_WANTS_AUTOGAIN) -Index: libv4l/lib/libv4lconvert/libv4lconvert.c -=================================================================== ---- libv4l.orig/lib/libv4lconvert/libv4lconvert.c 2011-08-05 14:35:43.592828552 +0200 -+++ libv4l/lib/libv4lconvert/libv4lconvert.c 2011-08-05 14:42:25.716824717 +0200 -@@ -160,8 +160,10 @@ - free(data); - return NULL; - } -- data->control_flags = v4lcontrol_get_flags(data->control); - data->bandwidth = v4lcontrol_get_bandwidth(data->control); -+ data->control_flags = v4lcontrol_get_flags(data->control); -+ if (data->control_flags & V4LCONTROL_FORCE_TINYJPEG) -+ data->flags |= V4LCONVERT_USE_TINYJPEG; - - data->processing = v4lprocessing_create(fd, data->control); - if (!data->processing) { diff -Nru v4l-utils-0.8.5/debian/patches/kfreebsd.diff v4l-utils-0.8.6/debian/patches/kfreebsd.diff --- v4l-utils-0.8.5/debian/patches/kfreebsd.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/kfreebsd.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -Author: Robert Millan -Description: Add kFreeBSD support -Bug-Debian: http://bugs.debian.org/647508 - ---- a/include/linux/videodev2.h -+++ b/include/linux/videodev2.h -@@ -61,9 +61,27 @@ - #else - #include - #endif -+ -+#ifdef linux - #include - #include - #include -+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -+#include -+#include -+typedef int8_t __s8; -+typedef int16_t __s16; -+typedef int32_t __s32; -+typedef int64_t __s64; -+typedef uint8_t __u8; -+typedef uint16_t __u16; -+typedef uint32_t __u32; -+typedef uint64_t __u64; -+typedef uint16_t __le16; -+typedef uint32_t __le32; -+typedef uint64_t __le64; -+#define __user -+#endif - - /* - * Common stuff for both V4L1 and V4L2 ---- a/lib/include/libv4l1-videodev.h -+++ b/lib/include/libv4l1-videodev.h -@@ -2,7 +2,12 @@ - #ifndef __LINUX_VIDEODEV_H - #define __LINUX_VIDEODEV_H - -+#ifdef linux - #include -+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) -+#include -+#endif -+ - #include - - #define VID_TYPE_CAPTURE 1 /* Can capture */ ---- a/lib/include/libv4lconvert.h -+++ b/lib/include/libv4lconvert.h -@@ -26,9 +26,7 @@ - #include - #include - #include --#endif -- --#ifdef __FreeBSD__ -+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - #include - #include - #include ---- a/lib/libv4lconvert/libv4lsyscall-priv.h -+++ b/lib/libv4lconvert/libv4lsyscall-priv.h -@@ -47,9 +47,7 @@ - #define SYS_mmap2 SYS_mmap - #define MMAP2_PAGE_SHIFT 0 - #endif --#endif -- --#ifdef __FreeBSD__ -+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - #include - #include - #include -@@ -83,9 +81,9 @@ - #define SYS_WRITE(fd, buf, len) \ - syscall(SYS_write, (int)(fd), (void *)(buf), (size_t)(len)); - --#ifdef __FreeBSD__ -+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - #define SYS_MMAP(addr, len, prot, flags, fd, off) \ -- __syscall(SYS_mmap, (void *)(addr), (size_t)(len), \ -+ syscall(SYS_mmap, (void *)(addr), (size_t)(len), \ - (int)(prot), (int)(flags), (int)(fd), (__off_t)(off)) - #else - #define SYS_MMAP(addr, len, prot, flags, fd, off) \ ---- a/Makefile -+++ b/Makefile -@@ -1,6 +1,10 @@ -+UNAME = $(shell uname -s) -+ - all install: - $(MAKE) -C lib $@ -+ifeq ($(UNAME), Linux) - $(MAKE) -C utils $@ -+endif - - sync-with-kernel: - @if [ ! -f $(KERNEL_DIR)/include/linux/videodev2.h -o \ diff -Nru v4l-utils-0.8.5/debian/patches/separate_libsubdir_for_v4lconvert.diff v4l-utils-0.8.6/debian/patches/separate_libsubdir_for_v4lconvert.diff --- v4l-utils-0.8.5/debian/patches/separate_libsubdir_for_v4lconvert.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/separate_libsubdir_for_v4lconvert.diff 2012-02-19 21:05:58.000000000 +0000 @@ -14,16 +14,16 @@ # These ones should not be overriden from the cmdline --- a/lib/libv4lconvert/Makefile +++ b/lib/libv4lconvert/Makefile -@@ -26,7 +26,7 @@ - CONVERT_OBJS += jpeg_memsrcdest.o - endif +@@ -20,7 +20,7 @@ + TARGETS = $(CONVERT_LIB) libv4lconvert.pc ov511-decomp ov518-decomp + INCLUDES = ../include/libv4lconvert.h -override CPPFLAGS += -DLIBDIR=\"$(LIBDIR)\" -DLIBSUBDIR=\"$(LIBSUBDIR)\" +override CPPFLAGS += -DLIBDIR=\"$(LIBDIR)\" -DLIBSUBDIR=\"$(LIBCONVERTSUBDIR)\" all: $(TARGETS) -@@ -48,7 +48,7 @@ +@@ -42,7 +42,7 @@ install: all mkdir -p $(DESTDIR)$(PREFIX)/include install -p -m 644 $(INCLUDES) $(DESTDIR)$(PREFIX)/include @@ -32,7 +32,7 @@ ifeq ($(LINKTYPE),static) install -m 644 $(CONVERT_LIB) $(DESTDIR)$(LIBDIR) else -@@ -56,7 +56,7 @@ +@@ -50,7 +50,7 @@ cd $(DESTDIR)$(LIBDIR) && \ ln -f -s $(CONVERT_LIB).$(LIB_RELEASE) $(CONVERT_LIB) endif diff -Nru v4l-utils-0.8.5/debian/patches/series v4l-utils-0.8.6/debian/patches/series --- v4l-utils-0.8.5/debian/patches/series 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/series 2012-02-19 21:02:27.000000000 +0000 @@ -1,12 +1 @@ -force_tinyjpeg_quirk.diff -allow-disabling-libjpeg.diff -update_upside_down_table-1.diff -update_upside_down_table-2.diff -update_upside_down_table-3.diff -update_upside_down_table-4.diff -update_upside_down_table-5.diff -update_upside_down_table-6.diff separate_libsubdir_for_v4lconvert.diff -fix_spelling_error.diff -disable_fancy_upsampling.diff -kfreebsd.diff diff -Nru v4l-utils-0.8.5/debian/patches/update_upside_down_table-1.diff v4l-utils-0.8.6/debian/patches/update_upside_down_table-1.diff --- v4l-utils-0.8.5/debian/patches/update_upside_down_table-1.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/update_upside_down_table-1.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -Origin: upstream, 3d22fe950f025b2faf3c1850441123a61f8884ff -From: Hans de Goede -Date: Sun, 24 Jul 2011 16:52:25 +0200 -Subject: [PATCH] libv4l: update upside down device list - -Signed-off-by: Hans de Goede ---- - lib/libv4lconvert/control/libv4lcontrol.c | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) - -diff --git a/lib/libv4lconvert/control/libv4lcontrol.c b/lib/libv4lconvert/control/libv4lcontrol.c -index b11d96c..3dcbd9e 100644 ---- a/lib/libv4lconvert/control/libv4lcontrol.c -+++ b/lib/libv4lconvert/control/libv4lcontrol.c -@@ -231,6 +231,9 @@ static const struct v4lcontrol_flags_info v4lcontrol_flags[] = { - { 0x04f2, 0xb169, 0, "FUJITSU", "FJNB219", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, - "FUJITSU", "LIFEBOOK T730" }, -+ { 0x04f2, 0xb169, 0, "FUJITSU", "FJNB21A", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, -+ "FUJITSU", "LIFEBOOK TH700" }, - { 0x04f2, 0xb16b, 0, "ASUSTeK Computer Inc. ", "U20A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb16b, 0, "ASUSTeK Computer Inc. ", "U80A ", -@@ -299,6 +302,8 @@ static const struct v4lcontrol_flags_info v4lcontrol_flags[] = { - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "P52Jc", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x04f2, 0xb217, 0, "LENOVO", "42992QG", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa111, 0, "ASUSTeK Computer Inc.", "F5RL ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa111, 0, "ASUSTeK Computer Inc. ", "F5SL ", --- -1.7.2.5 - diff -Nru v4l-utils-0.8.5/debian/patches/update_upside_down_table-2.diff v4l-utils-0.8.6/debian/patches/update_upside_down_table-2.diff --- v4l-utils-0.8.5/debian/patches/update_upside_down_table-2.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/update_upside_down_table-2.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -Origin: upstream, c73c2afe142cef73fddaec8bbc5ed40644c61176 -From: Hans de Goede -Date: Fri, 29 Jul 2011 09:18:38 +0200 -Subject: [PATCH] libv4l: update upside down device list - -Signed-off-by: Hans de Goede ---- - lib/libv4lconvert/control/libv4lcontrol.c | 2 ++ - 1 files changed, 2 insertions(+), 0 deletions(-) - -diff --git a/lib/libv4lconvert/control/libv4lcontrol.c b/lib/libv4lconvert/control/libv4lcontrol.c -index 3dcbd9e..ca6c798 100644 ---- a/lib/libv4lconvert/control/libv4lcontrol.c -+++ b/lib/libv4lconvert/control/libv4lcontrol.c -@@ -558,6 +558,8 @@ static const struct v4lcontrol_flags_info v4lcontrol_flags[] = { - "MicroLink", "S96S" }, - { 0x174f, 0x8a31, 0, "ASUSTeK Computer Inc. ", "F9E ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x174f, 0xa311, 0, "ASUSTeK Computer Inc. ", "A3E ", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0xa311, 0, "ASUSTeK Computer Inc. ", "A3F ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0xa311, 0, "ASUSTeK Computer Inc. ", "A3V ", --- -1.7.2.5 - diff -Nru v4l-utils-0.8.5/debian/patches/update_upside_down_table-3.diff v4l-utils-0.8.6/debian/patches/update_upside_down_table-3.diff --- v4l-utils-0.8.5/debian/patches/update_upside_down_table-3.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/update_upside_down_table-3.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -Origin: upstream, 71421b02f80be5f6ed9b2a92b93ce0e50a9f33ae -From: Hans de Goede -Date: Tue, 13 Sep 2011 23:16:32 +0200 -Subject: [PATCH 1/1] libv4l: update upside down webcam table - -Signed-off-by: Hans de Goede ---- - lib/libv4lconvert/control/libv4lcontrol.c | 17 +++++++++++++++++ - 1 files changed, 17 insertions(+), 0 deletions(-) - ---- a/lib/libv4lconvert/control/libv4lcontrol.c -+++ b/lib/libv4lconvert/control/libv4lcontrol.c -@@ -262,8 +262,12 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1b9, 0, "ASUSTeK Computer Inc. ", "U36JC", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x04f2, 0xb1b9, 0, "ASUSTeK Computer Inc.", "U36SD", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1b9, 0, "ASUSTeK Computer Inc. ", "U52F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x04f2, 0xb1bb, 0, "ASUSTeK Computer Inc. ", "N43JF", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1bb, 0, "ASUSTeK Computer Inc. ", "N61Da", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1bb, 0, "ASUSTeK Computer INC.", "N61Jv", -@@ -296,12 +300,17 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K52JT", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K52JV", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K52N", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "P52F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "P52Jc", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB19", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, -+ "FUJITSU", "LIFEBOOK NH751" }, - { 0x04f2, 0xb217, 0, "LENOVO", "42992QG", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa111, 0, "ASUSTeK Computer Inc.", "F5RL ", -@@ -316,6 +325,8 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "F82Q ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x064e, 0xa116, 0, "ASUSTeK Computer INC.", "K40AD", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K40IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K40IN ", -@@ -426,6 +437,8 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5111, 0, "ASUSTeK Computer INC.", "T101MT", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x13d3, 0x5120, 0, "ASUSTeK Computer Inc.", "K43E", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5120, 0, "ASUSTeK Computer Inc.", "K53E", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5120, 0, "ASUSTeK Computer Inc.", "K53SJ", -@@ -434,6 +447,8 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5120, 0, "ASUSTeK Computer Inc. ", "N73JG", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x13d3, 0x5120, 0, "ASUSTeK Computer Inc. ", "U31F", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N43JF", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc.", "N43SL", -@@ -562,6 +577,8 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0xa311, 0, "ASUSTeK Computer Inc. ", "A3F ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x174f, 0xa311, 0, "ASUSTeK Computer Inc. ", "A3H ", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0xa311, 0, "ASUSTeK Computer Inc. ", "A3V ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x1d4d, 0x1002, 0, "ASUSTeK Computer Inc. ", "B50A ", diff -Nru v4l-utils-0.8.5/debian/patches/update_upside_down_table-4.diff v4l-utils-0.8.6/debian/patches/update_upside_down_table-4.diff --- v4l-utils-0.8.5/debian/patches/update_upside_down_table-4.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/update_upside_down_table-4.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -Origin: upstream, b5939a0af472b7610f868cec4470e96c791047e7 -From: Hans de Goede -Date: Thu, 15 Sep 2011 10:48:42 +0200 -Subject: [PATCH] libv4l: Fix sorting of upside down device list - -Signed-off-by: Hans de Goede ---- - lib/libv4lconvert/control/libv4lcontrol.c | 9 ++++----- - 1 files changed, 4 insertions(+), 5 deletions(-) - ---- a/lib/libv4lconvert/control/libv4lcontrol.c -+++ b/lib/libv4lconvert/control/libv4lcontrol.c -@@ -325,8 +325,12 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "F82Q ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x064e, 0xa116, 0, "ASUSTeK Computer INC.", "K40AB", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer INC.", "K40AD", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x064e, 0xa116, 0, "ASUSTeK Computer INC.", "K50AD", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K40IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K40IN ", -@@ -385,11 +389,6 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "X58LE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -- /* Note no whitespace padding for these models, this is not a typo */ -- { 0x064e, 0xa116, 0, "ASUSTeK Computer INC.", "K40AB", -- V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -- { 0x064e, 0xa116, 0, "ASUSTeK Computer INC.", "K50AD", -- V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - /* 2 reports: - Unknown laptop model -> System Vendor: " IDEALMAX" - Síragon SL-6120 -> System Vendor: "PEGA PC" diff -Nru v4l-utils-0.8.5/debian/patches/update_upside_down_table-5.diff v4l-utils-0.8.6/debian/patches/update_upside_down_table-5.diff --- v4l-utils-0.8.5/debian/patches/update_upside_down_table-5.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/update_upside_down_table-5.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -Origin: upstream, 15616da05df33b49d475766127db43e0f1cb4296 -From: Hans de Goede -Date: Sun, 16 Oct 2011 16:45:04 +0200 -Subject: [PATCH] libv4l: Update upside down device table - -Signed-off-by: Hans de Goede ---- - lib/libv4lconvert/control/libv4lcontrol.c | 5 +++++ - 1 files changed, 5 insertions(+), 0 deletions(-) - ---- a/lib/libv4lconvert/control/libv4lcontrol.c -+++ b/lib/libv4lconvert/control/libv4lcontrol.c -@@ -308,6 +308,9 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "P52Jc", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB11", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, -+ "FUJITSU", "LIFEBOOK PH521" }, - { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB19", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, - "FUJITSU", "LIFEBOOK NH751" }, -@@ -462,6 +465,8 @@ - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N73JF", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, -+ { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N73Jn", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N73JQ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc.", "N73SV", diff -Nru v4l-utils-0.8.5/debian/patches/update_upside_down_table-6.diff v4l-utils-0.8.6/debian/patches/update_upside_down_table-6.diff --- v4l-utils-0.8.5/debian/patches/update_upside_down_table-6.diff 2011-11-14 09:58:21.000000000 +0000 +++ v4l-utils-0.8.6/debian/patches/update_upside_down_table-6.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -Origin: upstream, f957d56ec5a22a984463c253e3f1fe272ca464f6 -From: Hans de Goede -Date: Fri, 21 Oct 2011 22:03:09 +0200 -Subject: [PATCH] libv4l: update upside down device table - -Signed-off-by: Hans de Goede ---- - lib/libv4lconvert/control/libv4lcontrol.c | 3 +++ - 1 files changed, 3 insertions(+), 0 deletions(-) - ---- a/lib/libv4lconvert/control/libv4lcontrol.c -+++ b/lib/libv4lconvert/control/libv4lcontrol.c -@@ -311,6 +311,9 @@ - { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB11", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, - "FUJITSU", "LIFEBOOK PH521" }, -+ { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB16", -+ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, -+ "FUJITSU", "LIFEBOOK LH531" }, - { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB19", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, - "FUJITSU", "LIFEBOOK NH751" }, diff -Nru v4l-utils-0.8.5/include/linux/videodev2.h v4l-utils-0.8.6/include/linux/videodev2.h --- v4l-utils-0.8.5/include/linux/videodev2.h 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/include/linux/videodev2.h 2012-02-10 19:58:53.000000000 +0000 @@ -392,6 +392,7 @@ #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ +#define V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */ #define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */ #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ diff -Nru v4l-utils-0.8.5/lib/libv4l2/libv4l2.c v4l-utils-0.8.6/lib/libv4l2/libv4l2.c --- v4l-utils-0.8.5/lib/libv4l2/libv4l2.c 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4l2/libv4l2.c 2012-02-10 19:58:53.000000000 +0000 @@ -75,10 +75,9 @@ #define V4L2_BUFFERS_REQUESTED_BY_READ 0x0200 #define V4L2_STREAM_CONTROLLED_BY_READ 0x0400 #define V4L2_SUPPORTS_READ 0x0800 -#define V4L2_IS_UVC 0x1000 -#define V4L2_STREAM_TOUCHED 0x2000 -#define V4L2_USE_READ_FOR_READ 0x4000 -#define V4L2_SUPPORTS_TIMEPERFRAME 0x8000 +#define V4L2_STREAM_TOUCHED 0x1000 +#define V4L2_USE_READ_FOR_READ 0x2000 +#define V4L2_SUPPORTS_TIMEPERFRAME 0x4000 #define V4L2_MMAP_OFFSET_MAGIC 0xABCDEF00u @@ -327,7 +326,7 @@ if (result < 0 && errno == EAGAIN) { V4L2_LOG_ERR("got %d consecutive frame decode errors, last error: %s", max_tries, v4lconvert_get_error_message(devices[index].convert)); - errno = EAGAIN; + errno = EIO; } if (result < 0 && errno == EPIPE) { @@ -401,7 +400,7 @@ if (result < 0 && errno == EAGAIN) { V4L2_LOG_ERR("got %d consecutive frame decode errors, last error: %s", max_tries, v4lconvert_get_error_message(devices[index].convert)); - errno = EAGAIN; + errno = EIO; } if (result < 0 && errno == EPIPE) { @@ -644,8 +643,6 @@ driver on the first read */ devices[index].first_frame = V4L2_IGNORE_FIRST_FRAME_ERRORS; } - if (!strcmp((char *)cap.driver, "uvcvideo")) - devices[index].flags |= V4L2_IS_UVC; if ((parm.type == V4L2_BUF_TYPE_VIDEO_CAPTURE) && (parm.parm.capture.capability & V4L2_CAP_TIMEPERFRAME)) devices[index].flags |= V4L2_SUPPORTS_TIMEPERFRAME; @@ -841,6 +838,86 @@ devices[index].dest_fmt = *dest_fmt; } +static int v4l2_s_fmt(int index, struct v4l2_format *dest_fmt) +{ + struct v4l2_format src_fmt; + struct v4l2_pix_format req_pix_fmt; + int result; + + if (v4l2_log_file) { + int pixfmt = dest_fmt->fmt.pix.pixelformat; + + fprintf(v4l2_log_file, "VIDIOC_S_FMT app requesting: %c%c%c%c\n", + pixfmt & 0xff, + (pixfmt >> 8) & 0xff, + (pixfmt >> 16) & 0xff, + pixfmt >> 24); + } + + if (devices[index].flags & V4L2_DISABLE_CONVERSION) { + result = SYS_IOCTL(devices[index].fd, VIDIOC_TRY_FMT, + dest_fmt); + src_fmt = *dest_fmt; + } else { + result = v4lconvert_try_format(devices[index].convert, dest_fmt, + &src_fmt); + } + + if (result) { + int saved_err = errno; + V4L2_LOG("S_FMT error trying format: %s\n", strerror(errno)); + errno = saved_err; + return result; + } + + if (src_fmt.fmt.pix.pixelformat != dest_fmt->fmt.pix.pixelformat && + v4l2_log_file) { + int pixfmt = src_fmt.fmt.pix.pixelformat; + + fprintf(v4l2_log_file, "VIDIOC_S_FMT converting from: %c%c%c%c\n", + pixfmt & 0xff, + (pixfmt >> 8) & 0xff, + (pixfmt >> 16) & 0xff, + pixfmt >> 24); + } + + result = v4l2_check_buffer_change_ok(index); + if (result) + return result; + + req_pix_fmt = src_fmt.fmt.pix; + result = SYS_IOCTL(devices[index].fd, VIDIOC_S_FMT, &src_fmt); + if (result) { + int saved_err = errno; + V4L2_LOG_ERR("setting pixformat: %s\n", strerror(errno)); + /* Report to the app dest_fmt has not changed */ + *dest_fmt = devices[index].dest_fmt; + errno = saved_err; + return result; + } + /* See if we've gotten what try_fmt promised us + (this check should never fail) */ + if (src_fmt.fmt.pix.width != req_pix_fmt.width || + src_fmt.fmt.pix.height != req_pix_fmt.height || + src_fmt.fmt.pix.pixelformat != req_pix_fmt.pixelformat) { + V4L2_LOG_ERR("set_fmt gave us a different result then try_fmt!\n"); + /* Not what we expected / wanted, disable conversion */ + *dest_fmt = src_fmt; + } + + v4l2_set_src_and_dest_format(index, &src_fmt, dest_fmt); + + if (devices[index].flags & V4L2_SUPPORTS_TIMEPERFRAME) { + struct v4l2_streamparm parm = { + .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, + }; + if (SYS_IOCTL(devices[index].fd, VIDIOC_G_PARM, &parm) == 0) + v4l2_update_fps(index, &parm); + } + + return 0; +} + int v4l2_ioctl(int fd, unsigned long int request, ...) { void *arg; @@ -923,6 +1000,13 @@ stream_needs_locking = 1; } break; + case VIDIOC_S_STD: + case VIDIOC_S_INPUT: + case VIDIOC_S_DV_PRESET: + case VIDIOC_S_DV_TIMINGS: + is_capture_request = 1; + stream_needs_locking = 1; + break; } if (!is_capture_request) { @@ -948,11 +1032,8 @@ struct v4l2_format fmt = devices[index].dest_fmt; V4L2_LOG("Setting pixelformat to RGB24 (supported_dst_fmt_only)"); - devices[index].flags |= V4L2_STREAM_TOUCHED; fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_RGB24; - pthread_mutex_unlock(&devices[index].stream_lock); - v4l2_ioctl(fd, VIDIOC_S_FMT, &fmt); - pthread_mutex_lock(&devices[index].stream_lock); + v4l2_s_fmt(index, &fmt); V4L2_LOG("Done setting pixelformat (supported_dst_fmt_only)"); } devices[index].flags |= V4L2_STREAM_TOUCHED; @@ -1006,108 +1087,58 @@ } break; - case VIDIOC_S_FMT: { - struct v4l2_format src_fmt, *dest_fmt = arg; - struct v4l2_pix_format req_pix_fmt; - - /* Don't be lazy on uvc cams, as this triggers a bug in the uvcvideo - driver in kernel <= 2.6.28 (with certain cams) */ - if (!(devices[index].flags & V4L2_IS_UVC) && - v4l2_pix_fmt_compat(&devices[index].dest_fmt, dest_fmt)) { - *dest_fmt = devices[index].dest_fmt; - result = 0; - break; - } + case VIDIOC_S_FMT: + result = v4l2_s_fmt(index, arg); + break; - if (v4l2_log_file) { - int pixfmt = dest_fmt->fmt.pix.pixelformat; + case VIDIOC_G_FMT: { + struct v4l2_format *fmt = arg; - fprintf(v4l2_log_file, "VIDIOC_S_FMT app requesting: %c%c%c%c\n", - pixfmt & 0xff, - (pixfmt >> 8) & 0xff, - (pixfmt >> 16) & 0xff, - pixfmt >> 24); - } + *fmt = devices[index].dest_fmt; + result = 0; + break; + } - if (devices[index].flags & V4L2_DISABLE_CONVERSION) { - result = SYS_IOCTL(devices[index].fd, VIDIOC_TRY_FMT, - dest_fmt); - src_fmt = *dest_fmt; - } else { - result = v4lconvert_try_format(devices[index].convert, dest_fmt, - &src_fmt); - } + case VIDIOC_S_STD: + case VIDIOC_S_INPUT: + case VIDIOC_S_DV_PRESET: + case VIDIOC_S_DV_TIMINGS: { + struct v4l2_format src_fmt; - if (result) { - saved_err = errno; - V4L2_LOG("S_FMT error trying format: %s\n", strerror(errno)); - errno = saved_err; + result = SYS_IOCTL(devices[index].fd, request, arg); + if (result) break; - } - - if (src_fmt.fmt.pix.pixelformat != dest_fmt->fmt.pix.pixelformat && - v4l2_log_file) { - int pixfmt = src_fmt.fmt.pix.pixelformat; - fprintf(v4l2_log_file, "VIDIOC_S_FMT converting from: %c%c%c%c\n", - pixfmt & 0xff, - (pixfmt >> 8) & 0xff, - (pixfmt >> 16) & 0xff, - pixfmt >> 24); - } - - /* Maybe after try format has adjusted width/height etc, to whats - available nothing has changed (on the cam side) ? */ - if (!(devices[index].flags & V4L2_IS_UVC) && - v4l2_pix_fmt_compat(&devices[index].src_fmt, &src_fmt)) { - v4l2_set_src_and_dest_format(index, &devices[index].src_fmt, - dest_fmt); - result = 0; + /* These ioctls may have changed the device's fmt */ + src_fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + result = SYS_IOCTL(devices[index].fd, VIDIOC_G_FMT, &src_fmt); + if (result) { + V4L2_LOG_ERR("getting pixformat after %s: %s\n", + v4l2_ioctls[_IOC_NR(request)], + strerror(errno)); + result = 0; /* The original command did succeed */ break; } - result = v4l2_check_buffer_change_ok(index); - if (result) + if (v4l2_pix_fmt_compat(&devices[index].src_fmt, &src_fmt)) { + v4l2_set_src_and_dest_format(index, &src_fmt, + &devices[index].dest_fmt); break; + } - req_pix_fmt = src_fmt.fmt.pix; - result = SYS_IOCTL(devices[index].fd, VIDIOC_S_FMT, &src_fmt); + /* The fmt has been changed, remember the new format ... */ + devices[index].src_fmt = src_fmt; + devices[index].dest_fmt = src_fmt; + /* and try to restore the last set destination pixelformat. */ + src_fmt.fmt.pix.pixelformat = + devices[index].dest_fmt.fmt.pix.pixelformat; + result = v4l2_s_fmt(index, &src_fmt); if (result) { - saved_err = errno; - V4L2_LOG_ERR("setting pixformat: %s\n", strerror(errno)); - /* Report to the app dest_fmt has not changed */ - *dest_fmt = devices[index].dest_fmt; - errno = saved_err; - break; + V4L2_LOG_WARN("restoring destination pixelformat after %s failed\n", + v4l2_ioctls[_IOC_NR(request)]); + result = 0; /* The original command did succeed */ } - /* See if we've gotten what try_fmt promised us - (this check should never fail) */ - if (src_fmt.fmt.pix.width != req_pix_fmt.width || - src_fmt.fmt.pix.height != req_pix_fmt.height || - src_fmt.fmt.pix.pixelformat != req_pix_fmt.pixelformat) { - V4L2_LOG_ERR("set_fmt gave us a different result then try_fmt!\n"); - /* Not what we expected / wanted, disable conversion */ - *dest_fmt = src_fmt; - } - - v4l2_set_src_and_dest_format(index, &src_fmt, dest_fmt); - - if (devices[index].flags & V4L2_SUPPORTS_TIMEPERFRAME) { - struct v4l2_streamparm parm = { - .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, - }; - if (SYS_IOCTL(fd, VIDIOC_G_PARM, &parm) == 0) - v4l2_update_fps(index, &parm); - } - - break; - } - - case VIDIOC_G_FMT: { - struct v4l2_format *fmt = arg; - *fmt = devices[index].dest_fmt; - result = 0; break; } @@ -1192,8 +1223,7 @@ if (!v4l2_needs_conversion(index)) { result = SYS_IOCTL(devices[index].fd, VIDIOC_DQBUF, buf); if (result) { - int saved_err = errno; - + saved_err = errno; V4L2_LOG_ERR("dequeuing buf: %s\n", strerror(errno)); errno = saved_err; } diff -Nru v4l-utils-0.8.5/lib/libv4l2/libv4l2-priv.h v4l-utils-0.8.6/lib/libv4l2/libv4l2-priv.h --- v4l-utils-0.8.5/lib/libv4l2/libv4l2-priv.h 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4l2/libv4l2-priv.h 2012-02-10 19:58:53.000000000 +0000 @@ -90,6 +90,7 @@ }; /* From log.c */ +extern const char *v4l2_ioctls[]; void v4l2_log_ioctl(unsigned long int request, void *arg, int result); #endif diff -Nru v4l-utils-0.8.5/lib/libv4l2/log.c v4l-utils-0.8.6/lib/libv4l2/log.c --- v4l-utils-0.8.5/lib/libv4l2/log.c 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4l2/log.c 2012-02-10 19:58:53.000000000 +0000 @@ -31,7 +31,7 @@ FILE *v4l2_log_file = NULL; -static const char *v4l2_ioctls[] = { +const char *v4l2_ioctls[] = { /* start v4l2 ioctls */ [_IOC_NR(VIDIOC_QUERYCAP)] = "VIDIOC_QUERYCAP", [_IOC_NR(VIDIOC_RESERVED)] = "VIDIOC_RESERVED", diff -Nru v4l-utils-0.8.5/lib/libv4lconvert/control/libv4lcontrol.c v4l-utils-0.8.6/lib/libv4lconvert/control/libv4lcontrol.c --- v4l-utils-0.8.5/lib/libv4lconvert/control/libv4lcontrol.c 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4lconvert/control/libv4lcontrol.c 2012-02-10 19:58:53.000000000 +0000 @@ -23,7 +23,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -53,6 +55,7 @@ V4LCONTROL_HFLIPPED|V4LCONTROL_VFLIPPED | V4LCONTROL_WANTS_WB, 1500 }, /* Laptops (and all in one PC's) */ + /* 0x0402, 0x5602 - add quirk to driver/media/video/gspca/m5602/m5602_s5k4aa.c */ { 0x0402, 0x5606, 0, "CLEVO CO. ", "M570TU ", @@ -69,40 +72,6 @@ { 0x046d, 0x09b2, 0, "FUJITSU", "FJNB1C9", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, "FUJITSU", "LifeBook P7230" }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "F7E ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "F7F ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "F7Kr ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "F7L ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "F7Se ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "F7SR ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "F7Z ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "G50VT ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "T14C ", - V4LCONTROL_HFLIPPED|V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "W7S ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "W7Sg ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "X55SR ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "X55SV ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "X71Vn ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "X71Q ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "PEGATRON CORPORATION ", "X71SL ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb012, 0, "ASUSTeK Computer Inc. ", "X71Sr ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, /* Note no whitespace padding for board vendor, this is not a typo */ { 0x04f2, 0xb012, 0, "PEGATRON CORPORATION", "X71TL ", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, @@ -115,94 +84,7 @@ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, { 0x04f2, 0xb012, 0, "PACKARD BELL BV ", "EasyNote_BS45 ", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb034, 0, "ASUSTeK Computer Inc. ", "G70S ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb034, 0, "ASUSTeK Computer Inc. ", "G70Sg ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb036, 0, "ASUSTeK Computer Inc. ", "U6E ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb036, 0, "ASUSTeK Computer Inc. ", "U6S ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb036, 0, "ASUSTeK Computer Inc. ", "U6Sg ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb036, 0, "ASUSTeK Computer Inc. ", "U6V ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb036, 0, "ASUSTeK Computer Inc. ", "UL30A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb036, 0, "ASUSTeK Computer Inc. ", "UL30VT ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb036, 0, "ASUSTeK Computer Inc. ", "UL50Ag ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb036, 0, "ASUSTeK Computer Inc. ", "UL50VT ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "F3Ke ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "F52A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "F52Q ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K40IE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K40IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K40IN ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K50ID ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K50IE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K50IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K50IN ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K51AC ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K51AE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K52F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K52Jr", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K61IC ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K70AB ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K70AC ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K70AD ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K70AE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K70IC ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K70IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "K70IO ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "N10J ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "N10Jc ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "N20A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "N51Vn ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "N61Vn ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "N61Vg ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUS CORPORATION ", "N90SC ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "U6Vc ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer Inc. ", "X58LE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - /* Note no whitespace padding for these b071 models, this is not a typo */ - { 0x04f2, 0xb071, 0, "ASUSTeK Computer INC.", "K40AB", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer INC.", "K50AB", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb071, 0, "ASUSTeK Computer INC.", "N5051Tp", + { 0x04f2, 0xb012, 0, "PACKARD BELL BV ", "EasyNote_F0945", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, { 0x04f2, 0xb071, 0, "AXIOO", "PICO DJH Model", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, @@ -211,35 +93,17 @@ { 0x04f2, 0xb071, 0, "PEGATRON CORP.", NULL, V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, "Philco", "S\202rie PHN10050" }, - { 0x04f2, 0xb072, 0, "ASUSTeK Computer Inc. ", "K50IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb106, 0, "ASUSTeK Computer Inc. ", "N50Vc ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb106, 0, "ASUSTeK Computer Inc. ", "N50Vn ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb106, 0, "ASUSTeK Computer Inc. ", "N51Vf ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb106, 0, "ASUSTeK Computer Inc. ", "N51Vg ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb106, 0, "ASUSTeK Computer Inc. ", "N51Vn ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb106, 0, "ASUSTeK Computer INC.", "N5051Tp", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, { 0x04f2, 0xb169, 0, "FUJITSU", "FJNB206", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, "FUJITSU", "LifeBook T4410" }, { 0x04f2, 0xb169, 0, "FUJITSU", "FJNB219", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, "FUJITSU", "LIFEBOOK T730" }, + { 0x04f2, 0xb169, 0, "FUJITSU", "FJNB21A", + V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, + "FUJITSU", "LIFEBOOK TH700" }, { 0x04f2, 0xb16b, 0, "ASUSTeK Computer Inc. ", "U20A ", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb16b, 0, "ASUSTeK Computer Inc. ", "U80A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - /* HDG: not sure if this one is needed, the one above is */ - { 0x04f2, 0xb16b, 0, "ASUSTeK Computer Inc. ", "U80A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb16b, 0, "ASUSTeK Computer Inc. ", "U80V ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, /* 1 report: Unknown laptop model -> System Vendor: " IDEALMAX" But given that the System Vendor is "unstable" for the other @@ -253,127 +117,27 @@ { 0x04f2, 0xb186, 0, "FUJITSU", "FJNB206", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, "FUJITSU", "LifeBook T4310" }, - { 0x04f2, 0xb1b9, 0, "ASUSTeK Computer Inc. ", "U31F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1b9, 0, "ASUSTeK Computer Inc. ", "U31Jg", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1b9, 0, "ASUSTeK Computer Inc. ", "U36JC", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1b9, 0, "ASUSTeK Computer Inc. ", "U52F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1bb, 0, "ASUSTeK Computer Inc. ", "N61Da", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1bb, 0, "ASUSTeK Computer INC.", "N61Jv", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1bb, 0, "ASUSTeK Computer Inc. ", "N82JV", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1bb, 0, "ASUSTeK Computer Inc. ", "N82JQ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1bb, 0, "ASUSTeK Computer Inc. ", "U53Jc", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1be, 0, "ASUSTeK Computer Inc. ", "UL30A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1be, 0, "ASUSTeK Computer Inc. ", "UL30JT", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1be, 0, "ASUSTeK Computer Inc. ", "UL30VT ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1be, 0, "ASUSTeK Computer Inc. ", "U35JC", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1be, 0, "ASUSTeK Computer Inc. ", "UL50VT ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K50IE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K52De", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K52Dr", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K52F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K52Jc", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K52JT", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "K52N", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "P52F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x04f2, 0xb1e5, 0, "ASUSTeK Computer Inc. ", "P52Jc", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa111, 0, "ASUSTeK Computer Inc.", "F5RL ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa111, 0, "ASUSTeK Computer Inc. ", "F5SL ", + { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB11", + V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, + "FUJITSU", "LIFEBOOK PH521" }, + { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB13", + V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, + "FUJITSU", "LIFEBOOK SH531" }, + { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB16", + V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, + "FUJITSU", "LIFEBOOK LH531" }, + { 0x04f2, 0xb213, 0, "FUJITSU", "FJNBB19", + V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, + "FUJITSU", "LIFEBOOK NH751" }, + { 0x04f2, 0xb217, 0, "LENOVO", "42992QG", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, + { 0x064e, 0xa111, 0, "Acer, Inc.", "Prespa1 ", + V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, + "Acer, inc.", "Aspire 5570 " }, { 0x064e, 0xa111, 0, "PEGATRON CORPORATION ", "F5C ", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, { 0x064e, 0xa111, 0, "PEGATRON CORPORATION ", "F5SR ", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUS CORPORATION ", "F70SL ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "F82Q ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K40IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K40IN ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K50ID ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K50IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K50IN ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K51AC ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K51AE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K52Jr", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K60IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K60IN ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K61IC ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K70AB ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K70AC ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K70AD ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K70AE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K70IC ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K70IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "K70IO ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "N10E ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "N10J ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "N10Jb ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "N10Jc ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "N20A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "N61Vn ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUS CORPORATION ", "N70SV ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUS CORPORATION ", "N90SV ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "U6Vc ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "U80V ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer Inc. ", "X58LE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - /* Note no whitespace padding for these models, this is not a typo */ - { 0x064e, 0xa116, 0, "ASUSTeK Computer INC.", "K40AB", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa116, 0, "ASUSTeK Computer INC.", "K50AD", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, /* 2 reports: Unknown laptop model -> System Vendor: " IDEALMAX" Síragon SL-6120 -> System Vendor: "PEGA PC" @@ -381,184 +145,13 @@ { 0x064e, 0xa116, 0, "To be filled by O.E.M.", "H34", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, NULL, "H34" }, - { 0x064e, 0xa136, 0, "ASUSTeK Computer Inc. ", "UL30A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa136, 0, "ASUSTeK Computer Inc. ", "UL30VT ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa136, 0, "ASUSTeK Computer Inc. ", "U35F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa136, 0, "ASUSTeK Computer Inc. ", "U35JC", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa136, 0, "ASUSTeK Computer Inc. ", "UL50A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa136, 0, "ASUSTeK Computer Inc. ", "UL50Ag ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa136, 0, "ASUSTeK Computer Inc. ", "UL50AT ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa136, 0, "ASUSTeK Computer Inc. ", "UL50Vg ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x064e, 0xa136, 0, "ASUSTeK Computer Inc. ", "UL50VT ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, { 0x064e, 0xa212, 0, "MEDIONAG", "WeTab ", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x090c, 0xe370, 0, "ASUSTeK Computer Inc. ", "U6S ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x090c, 0xe370, 0, "ASUSTeK Computer Inc. ", "U6Sg ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x090c, 0xe370, 0, "ASUSTeK Computer Inc. ", "VX3 ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5094, 0, "ASUS CORPORATION ", "K50C ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5094, 0, "ASUSTeK Computer Inc. ", "K50IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5094, 0, "ASUSTeK Computer Inc. ", "K52F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5094, 0, "ASUSTeK Computer Inc. ", "K60IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5094, 0, "ASUSTeK Computer Inc. ", "P50IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5094, 0, "ASUSTeK Computer Inc. ", "P81IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5111, 0, "ASUSTeK Computer INC.", "T101MT", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5120, 0, "ASUSTeK Computer Inc.", "K53E", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5120, 0, "ASUSTeK Computer Inc.", "K53SJ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5120, 0, "ASUSTeK Computer Inc.", "K53SV", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5120, 0, "ASUSTeK Computer Inc. ", "N73JG", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N43JF", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc.", "N43SL", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N61Da", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N61Ja", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N61Jq", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer INC.", "N61Jv", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N73JF", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "N73JQ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc.", "N73SV", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "U33Jc", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5122, 0, "ASUSTeK Computer Inc. ", "U53Jc", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5126, 0, "ASUSTeK Computer INC.", "T101MT", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer INC.", "K40AE", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer INC.", "K40AF", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer INC.", "K50AF", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUS CORPORATION ", "K50C ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K50ID ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K50IE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K50IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K50IP ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52De", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52Dr", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52Jc", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52JB", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52Je", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52JK", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52Jr", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52JT", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52JU", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K52N", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K60IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K70AF ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "K70ID ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "P50IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "P52F", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5130, 0, "ASUSTeK Computer Inc. ", "P81IJ ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x13d3, 0x5702, 0, "ASUSTeK Computer INC.", "900AX", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x1120, 0, "ASUSTeK Computer Inc. ", "K50ID ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x1120, 0, "ASUSTeK Computer Inc. ", "K50IE ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x1120, 0, "ASUSTeK Computer Inc. ", "K52Je", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x1408, 0, "ASUSTeK Computer Inc. ", "K40IN ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x1408, 0, "ASUSTeK Computer Inc. ", "K50IN ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F3E ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F3Ka ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F3Ke ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F3Q ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F3Sa ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F3Sg ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F3Sr ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F5N ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F5GL ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - /* Note no whitespace padding for vendor, this is not a typo */ - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc.", "F5RL ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F5SL ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "F5Z ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "G1S ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "G1Sn ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0x5a35, 0, "ASUSTeK Computer Inc. ", "G2S ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, { 0x174f, 0x5a35, 0, "PEGATRON CORPORATION ", "F5SL ", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, { 0x174f, 0x6a51, 0, NULL, "S96S", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, "MicroLink", "S96S" }, - { 0x174f, 0x8a31, 0, "ASUSTeK Computer Inc. ", "F9E ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0xa311, 0, "ASUSTeK Computer Inc. ", "A3F ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x174f, 0xa311, 0, "ASUSTeK Computer Inc. ", "A3V ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, - { 0x1d4d, 0x1002, 0, "ASUSTeK Computer Inc. ", "B50A ", - V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, { 0x5986, 0x0200, 0, "LENOVO", "SPEEDY ", V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED, 0, NULL, NULL, NULL, "Lenovo IdeaPad Y510" }, @@ -572,6 +165,8 @@ V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED }, /* Second: devices which should use some software processing by default */ + /* jl2005bcd devices */ + { 0x0979, 0x0227, 0, NULL, NULL, V4LCONTROL_WANTS_WB }, /* sn9c101 / sn9c102 based devices (sonixb) */ { 0x0c45, 0x6011, 0, NULL, NULL, 0, 1500 }, /* OV6650, no WB needed */ { 0x0c45, 0x6019, 0, NULL, NULL, 0, 1500 }, /* OV7630, no WB needed */ @@ -596,6 +191,8 @@ V4LCONTROL_ROTATED_90_JPEG | V4LCONTROL_WANTS_WB, 1500 }, { 0x06f8, 0x3009, 0, NULL, NULL, V4LCONTROL_ROTATED_90_JPEG | V4LCONTROL_WANTS_WB, 1500 }, + { 0x145f, 0x013c, 0, NULL, NULL, + V4LCONTROL_ROTATED_90_JPEG | V4LCONTROL_WANTS_WB, 1500 }, /* Pac7311 based devices */ { 0x093a, 0x2600, 0x0f, NULL, NULL, V4LCONTROL_WANTS_WB }, /* sq905 devices */ @@ -633,24 +230,88 @@ V4LCONTROL_HFLIPPED | V4LCONTROL_WANTS_WB_AUTOGAIN }, { 0x047d, 0x5003, 0, NULL, NULL, V4LCONTROL_HFLIPPED | V4LCONTROL_WANTS_WB_AUTOGAIN }, + /* W996xCF based cams, must use jpeglite because of funky JPEG fmt */ + { 0x041e, 0x4003, 0, NULL, NULL, V4LCONTROL_FORCE_TINYJPEG }, + { 0x1046, 0x9967, 0, NULL, NULL, V4LCONTROL_FORCE_TINYJPEG }, }; static const struct v4l2_queryctrl fake_controls[]; -static void v4lcontrol_get_dmi_string(const char *string, char *buf, int size) +static const char *asus_board_vendor[] = { + "ASUSTeK Computer Inc.", + "ASUSTeK Computer INC.", + "ASUS CORPORATION", + NULL }; + +static const char *asus_board_name[] = { + "A3[A-Z]*", + "B50[A-Z]*", + "F[3579][A-Z]*", "F70[A-Z]*", "F[58]2[A-Z]*", + "G[12][A-Z]*", "G[57]0[A-Z]*", + "K[4567]0[A-Z]*", "K[56]1[A-Z]*", "K52[A-Z]*", "K[45]3[A-Z]*", + "N[12579]0[A-Z]*", "N[56]1[A-Z]*", "N82[A-Z]*", "N[47]3[A-Z]*", + "P5[02][A-Z]*", "P81[A-Z]*", + "U6[A-Z]*", "U[28]0[A-Z]*", "U3[1356][A-Z]*", "U5[23][A-Z]*", + "UL[35]0[A-Z]*", + "X55[A-Z]*", "X58[A-Z]*", "X71[A-Z]*", + /* special devices */ + "900AX", + "N5051Tp", "NX90Jq", + "T101MT", "T14C", + "VX3", + "W7S*", + NULL }; + +static const struct v4lcontrol_usb_id asus_camera_id[] = { + { 0x04f2, 0xb012 }, + { 0x04f2, 0xb034 }, + { 0x04f2, 0xb036 }, + { 0x04f2, 0xb071 }, + { 0x04f2, 0xb072 }, + { 0x04f2, 0xb106 }, + { 0x04f2, 0xb16b }, + { 0x04f2, 0xb1b9 }, + { 0x04f2, 0xb1bb }, + { 0x04f2, 0xb1be }, + { 0x04f2, 0xb1e5 }, + { 0x064e, 0xa111 }, + { 0x064e, 0xa116 }, + { 0x064e, 0xa136 }, + { 0x090c, 0xe370 }, + { 0x13d3, 0x5094 }, + { 0x13d3, 0x5111 }, + { 0x13d3, 0x5120 }, + { 0x13d3, 0x5122 }, + { 0x13d3, 0x5126 }, + { 0x13d3, 0x5130 }, + { 0x13d3, 0x5702 }, + { 0x174f, 0x1120 }, + { 0x174f, 0x1408 }, + { 0x174f, 0x5a35 }, + { 0x174f, 0x8a31 }, + { 0x174f, 0xa311 }, + { 0x1d4d, 0x1002 }, + { 0x0000, 0x0000 } +}; + +static const struct v4lcontrol_upside_down_table upside_down[] = { + { asus_board_vendor, asus_board_name, asus_camera_id }, +}; + +static void v4lcontrol_get_dmi_string(const char *sysfs_prefix, const char *string, char *buf, int size) { FILE *f; char *s, sysfs_name[512]; snprintf(sysfs_name, sizeof(sysfs_name), - "/sys/class/dmi/id/%s", string); + "%s/sys/class/dmi/id/%s", sysfs_prefix, string); f = fopen(sysfs_name, "r"); if (!f) { /* Try again with a different sysfs path, not sure if this is needed but we used to look under /sys/devices/virtual/dmi/id in older libv4l versions, but this did not work with some kernels */ snprintf(sysfs_name, sizeof(sysfs_name), - "/sys/devices/virtual/dmi/id/%s", string); + "%s/sys/devices/virtual/dmi/id/%s", sysfs_prefix, string); f = fopen(sysfs_name, "r"); if (!f) { buf[0] = 0; @@ -665,6 +326,7 @@ } static int v4lcontrol_get_usb_info(struct v4lcontrol_data *data, + const char *sysfs_prefix, unsigned short *vendor_id, unsigned short *product_id, int *speed) { @@ -680,7 +342,7 @@ /* find ourselve in sysfs */ for (i = 0; i < 256; i++) { snprintf(sysfs_name, sizeof(sysfs_name), - "/sys/class/video4linux/video%d/dev", i); + "%s/sys/class/video4linux/video%d/dev", sysfs_prefix, i); f = fopen(sysfs_name, "r"); if (!f) continue; @@ -697,7 +359,7 @@ /* Get vendor and product ID */ snprintf(sysfs_name, sizeof(sysfs_name), - "/sys/class/video4linux/video%d/device/modalias", i); + "%s/sys/class/video4linux/video%d/device/modalias", sysfs_prefix, i); f = fopen(sysfs_name, "r"); if (f) { s = fgets(buf, sizeof(buf), f); @@ -708,7 +370,7 @@ return 0; /* Not an USB device */ snprintf(sysfs_name, sizeof(sysfs_name), - "/sys/class/video4linux/video%d/device/../speed", i); + "%s/sys/class/video4linux/video%d/device/../speed", sysfs_prefix, i); } else { /* Try again assuming the device link points to the usb device instead of the usb interface (bug in older versions @@ -716,7 +378,7 @@ /* Get vendor ID */ snprintf(sysfs_name, sizeof(sysfs_name), - "/sys/class/video4linux/video%d/device/idVendor", i); + "%s/sys/class/video4linux/video%d/device/idVendor", sysfs_prefix, i); f = fopen(sysfs_name, "r"); if (!f) return 0; /* Not an USB device (or no sysfs) */ @@ -730,7 +392,7 @@ /* Get product ID */ snprintf(sysfs_name, sizeof(sysfs_name), - "/sys/class/video4linux/video%d/device/idProduct", i); + "%s/sys/class/video4linux/video%d/device/idProduct", sysfs_prefix, i); f = fopen(sysfs_name, "r"); if (!f) return 0; /* Should never happen */ @@ -743,7 +405,7 @@ return 0; /* Should never happen */ snprintf(sysfs_name, sizeof(sysfs_name), - "/sys/class/video4linux/video%d/device/speed", i); + "%s/sys/class/video4linux/video%d/device/speed", sysfs_prefix, i); } f = fopen(sysfs_name, "r"); @@ -759,7 +421,54 @@ return 1; } +/* + * Tries to match value in NULL terminated table_entries string array + * aganist the space trimmed dmi_value. The upside down table entries + * might contain shell wildcard patterns [see glob(7)]. + * + * Returns non zero value if value is found, otherwise 0. + */ +static int find_dmi_string(const char **table_entries, const char *dmi_value) +{ + const char *start = dmi_value; + const char **entry_ptr; + char *trimmed_dmi; + size_t n; + + if (!start) return 0; + + /* trim value */ + while (isspace(*start)) start++; + n = strlen(start); + while (n > 0 && isspace(start[n-1])) --n; + trimmed_dmi = strndupa(start, n); + + /* find trimmed value */ + for (entry_ptr = table_entries; *entry_ptr; entry_ptr++) { + const int found = fnmatch(*entry_ptr, trimmed_dmi, 0) == 0; + /* fprintf(stderr, "find_dmi_string('%s', '%s'->'%s')=%i\n", *entry_ptr, dmi_value, trimmed_dmi, found); */ + if (found) + return 1; + } + return 0; +} + +/* + * Tries to find an USB id in table_entries array + * + * Returns non zero value if value is found, otherwise 0. + */ +static int find_usb_id(const struct v4lcontrol_usb_id *table_entries, + unsigned short vendor_id, unsigned short product_id) +{ + const struct v4lcontrol_usb_id *entry_ptr; + for (entry_ptr = table_entries; entry_ptr->vendor_id && entry_ptr->product_id; ++entry_ptr) + if (entry_ptr->vendor_id == vendor_id && entry_ptr->product_id == product_id) return 1; + return 0; +} + static void v4lcontrol_get_flags_from_db(struct v4lcontrol_data *data, + const char *sysfs_prefix, unsigned short vendor_id, unsigned short product_id) { char dmi_system_vendor[512], dmi_system_name[512], dmi_system_version[512]; @@ -767,20 +476,29 @@ int i; /* Get DMI board and system strings */ - v4lcontrol_get_dmi_string("sys_vendor", dmi_system_vendor, + v4lcontrol_get_dmi_string(sysfs_prefix, "sys_vendor", dmi_system_vendor, sizeof(dmi_system_vendor)); - v4lcontrol_get_dmi_string("product_name", dmi_system_name, + v4lcontrol_get_dmi_string(sysfs_prefix, "product_name", dmi_system_name, sizeof(dmi_system_name)); - v4lcontrol_get_dmi_string("product_version", dmi_system_version, + v4lcontrol_get_dmi_string(sysfs_prefix, "product_version", dmi_system_version, sizeof(dmi_system_version)); - v4lcontrol_get_dmi_string("board_vendor", dmi_board_vendor, + v4lcontrol_get_dmi_string(sysfs_prefix, "board_vendor", dmi_board_vendor, sizeof(dmi_board_vendor)); - v4lcontrol_get_dmi_string("board_name", dmi_board_name, + v4lcontrol_get_dmi_string(sysfs_prefix, "board_name", dmi_board_name, sizeof(dmi_board_name)); - v4lcontrol_get_dmi_string("board_version", dmi_board_version, + v4lcontrol_get_dmi_string(sysfs_prefix, "board_version", dmi_board_version, sizeof(dmi_board_version)); + for (i = 0; i < ARRAY_SIZE(upside_down); i++) + if (find_dmi_string(upside_down[i].board_vendor, dmi_board_vendor) && + find_dmi_string(upside_down[i].board_name, dmi_board_name) && + find_usb_id(upside_down[i].camera_id, vendor_id, product_id)) { + /* found entry */ + data->flags |= V4LCONTROL_HFLIPPED | V4LCONTROL_VFLIPPED; + break; + } + for (i = 0; i < ARRAY_SIZE(v4lcontrol_flags); i++) if (v4lcontrol_flags[i].vendor_id == vendor_id && v4lcontrol_flags[i].product_id == @@ -835,10 +553,14 @@ data->flags |= V4LCONTROL_VFLIPPED; } - got_usb_info = v4lcontrol_get_usb_info(data, &vendor_id, &product_id, + s = getenv("LIBV4LCONTROL_SYSFS_PREFIX"); + if (!s) + s = ""; + + got_usb_info = v4lcontrol_get_usb_info(data, s, &vendor_id, &product_id, &speed); if (got_usb_info) { - v4lcontrol_get_flags_from_db(data, vendor_id, product_id); + v4lcontrol_get_flags_from_db(data, s, vendor_id, product_id); switch (speed) { case 12: data->bandwidth = 1023 * 1000; diff -Nru v4l-utils-0.8.5/lib/libv4lconvert/control/libv4lcontrol.h v4l-utils-0.8.6/lib/libv4lconvert/control/libv4lcontrol.h --- v4l-utils-0.8.5/lib/libv4lconvert/control/libv4lcontrol.h 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4lconvert/control/libv4lcontrol.h 2012-02-10 19:58:53.000000000 +0000 @@ -28,6 +28,7 @@ #define V4LCONTROL_ROTATED_90_JPEG 0x04 #define V4LCONTROL_WANTS_WB 0x08 #define V4LCONTROL_WANTS_AUTOGAIN 0x10 +#define V4LCONTROL_FORCE_TINYJPEG 0x20 /* Masks */ #define V4LCONTROL_WANTS_WB_AUTOGAIN (V4LCONTROL_WANTS_WB | V4LCONTROL_WANTS_AUTOGAIN) diff -Nru v4l-utils-0.8.5/lib/libv4lconvert/control/libv4lcontrol-priv.h v4l-utils-0.8.6/lib/libv4lconvert/control/libv4lcontrol-priv.h --- v4l-utils-0.8.5/lib/libv4lconvert/control/libv4lcontrol-priv.h 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4lconvert/control/libv4lcontrol-priv.h 2012-02-10 19:58:53.000000000 +0000 @@ -62,4 +62,15 @@ const char *dmi_system_version; }; +struct v4lcontrol_usb_id { + unsigned short vendor_id; + unsigned short product_id; +}; + +struct v4lcontrol_upside_down_table { + const char **board_vendor; + const char **board_name; + const struct v4lcontrol_usb_id *camera_id; +}; + #endif diff -Nru v4l-utils-0.8.5/lib/libv4lconvert/jl2005bcd.c v4l-utils-0.8.6/lib/libv4lconvert/jl2005bcd.c --- v4l-utils-0.8.5/lib/libv4lconvert/jl2005bcd.c 1970-01-01 00:00:00.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4lconvert/jl2005bcd.c 2012-02-10 19:58:53.000000000 +0000 @@ -0,0 +1,212 @@ +/* jl2005bcd.c + * + * Converts raw output from Jeilin JL2005B/C/D to Bayer output. + * + * The code is based upon what is found in libgphoto2/camlibs/jl2005c, + * Copyright (c) 2010 Theodore Kilgore + * + * The decompression code used is + * Copyright (c) 2010 Hans de Goede + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include + +#include "libv4lconvert-priv.h" +#include "jpeg_memsrcdest.h" +#include "libv4lsyscall-priv.h" + + +#define JPEG_HEADER_SIZE 338 +#define JPEG_HEIGHT_OFFSET 94 + +static int find_eoi(struct v4lconvert_data *data, + const unsigned char *jpeg_data, int jpeg_data_idx, int jpeg_data_size) +{ + int i; + + for (i = jpeg_data_idx; i < (jpeg_data_size - 1); i++) + if (jpeg_data[i] == 0xff && jpeg_data[i + 1] == 0xd9) + break; + + if (i >= (jpeg_data_size - 1)) { + V4LCONVERT_ERR("incomplete jl2005bcd frame\n"); + return -1; + } + + return i + 2; /* + 2 -> Point to after EOI marker */ +} + + +int v4lconvert_decode_jl2005bcd(struct v4lconvert_data *data, + const unsigned char *src, int src_size, + unsigned char *dest, int width, int height) +{ + unsigned char jpeg_stripe[50000]; + int q; + struct jpeg_compress_struct cinfo; + struct jpeg_decompress_struct dinfo; + struct jpeg_error_mgr jcerr, jderr; + JOCTET *jpeg_header = NULL; + unsigned long jpeg_header_size = 0; + int i, x, y, x1, y1, jpeg_data_size, jpeg_data_idx, eoi, size; + + /* src_size had better be bigger than 16 */ + if (src_size < 16) + return 1; + + /* The first 16 bytes of src are a raw frame header */ + q = src[13] & 0x7f; + + if (height != src[4] << 3) { + V4LCONVERT_ERR("Height is %d, not %d\n", src[4] << 3, height); + return 1; + } + + if (width != src[5] << 3) { + V4LCONVERT_ERR("Width is %d, not %d\n", src[5] << 3, width); + return 1; + } + + /* + * And the fun begins, first of all create a dummy jpeg, which we use + * to get the headers from to feed to libjpeg when decompressing the + * stripes. This way we can use libjpeg's quant table handling + * (and built in default huffman tables). + */ + cinfo.err = jpeg_std_error (&jcerr); + jpeg_create_compress (&cinfo); + jpeg_mem_dest (&cinfo, &jpeg_header, &jpeg_header_size); + cinfo.image_width = 16; + cinfo.image_height = 16; + cinfo.input_components = 3; + cinfo.in_color_space = JCS_RGB; + jpeg_set_defaults (&cinfo); + /* Make comp[0] (which will be green) 1x2 subsampled */ + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 2; + /* Make comp[1] and [2] use huffman table and quanttable 0, as all + * components use luminance settings with the jl2005c/d/e */ + cinfo.comp_info[1].quant_tbl_no = 0; + cinfo.comp_info[1].dc_tbl_no = 0; + cinfo.comp_info[1].ac_tbl_no = 0; + cinfo.comp_info[2].quant_tbl_no = 0; + cinfo.comp_info[2].dc_tbl_no = 0; + cinfo.comp_info[2].ac_tbl_no = 0; + /* Apply the quality setting from the header */ + if (q <= 0) + i = 5000; + else if (q <= 50) + i = 5000 / q; + else if (q <= 100) + i = 2 * (100 - q); + else + i = 0; + jpeg_set_linear_quality(&cinfo, i, TRUE); + + jpeg_start_compress (&cinfo, TRUE); + while( cinfo.next_scanline < cinfo.image_height ) { + JOCTET row[16 * 3]; + JSAMPROW row_pointer[1] = { row }; + jpeg_write_scanlines (&cinfo, row_pointer, 1); + } + jpeg_finish_compress (&cinfo); + jpeg_destroy_compress (&cinfo); + + JSAMPLE green[8 * 16]; + JSAMPLE red[8 * 8]; + JSAMPLE blue[8 * 8]; + JSAMPROW green_row_pointer[16]; + JSAMPROW red_row_pointer[8]; + JSAMPROW blue_row_pointer[8]; + + for (i = 0; i < 16; i++) + green_row_pointer[i] = green + i * 8; + + for (i = 0; i < 8; i++) { + red_row_pointer[i] = red + i * 8; + blue_row_pointer[i] = blue + i * 8; + } + + JSAMPARRAY samp_image[3] = { green_row_pointer, + red_row_pointer, + blue_row_pointer }; + + memcpy(jpeg_stripe, jpeg_header, JPEG_HEADER_SIZE); + jpeg_stripe[JPEG_HEIGHT_OFFSET ] = height >> 8; + jpeg_stripe[JPEG_HEIGHT_OFFSET + 1] = height; + jpeg_stripe[JPEG_HEIGHT_OFFSET + 2] = 0; + jpeg_stripe[JPEG_HEIGHT_OFFSET + 3] = 8; + free (jpeg_header); + /* Get past the raw frame header. */ + src += 16; + jpeg_data_size = src_size - 16; + + jpeg_data_idx = 0; + + + dinfo.err = jpeg_std_error (&jderr); + jpeg_create_decompress (&dinfo); + for (x = 0; x < width; x += 16) { + eoi = find_eoi(data, src, jpeg_data_idx, jpeg_data_size); + if (eoi < 0) + return eoi; + + size = eoi - jpeg_data_idx; + if ((JPEG_HEADER_SIZE + size) > sizeof(jpeg_stripe)) { + V4LCONVERT_ERR("stripe size too big %d > %ld\n", + JPEG_HEADER_SIZE + size, + sizeof(jpeg_stripe)); + return 1; + } + memcpy (jpeg_stripe + JPEG_HEADER_SIZE, + src + jpeg_data_idx, size); + + jpeg_mem_src (&dinfo, jpeg_stripe, JPEG_HEADER_SIZE + size); + jpeg_read_header (&dinfo, TRUE); + dinfo.raw_data_out = TRUE; +#if JPEG_LIB_VERSION >= 70 + dinfo.do_fancy_upsampling = FALSE; +#endif + jpeg_start_decompress (&dinfo); + for (y = 0; y < height; y += 16) { + jpeg_read_raw_data (&dinfo, samp_image, 16); + for (y1 = 0; y1 < 16; y1 += 2) { + for (x1 = 0; x1 < 16; x1 += 2) { + dest[((y + y1 + 0) * width + + x + x1 + 0)] + = red[y1 * 4 + x1 / 2]; + dest[((y + y1 + 0) * width + + x + x1 + 1)] + = green[y1 * 8 + x1 / 2]; + dest[((y + y1 + 1) * width + + x + x1 + 0)] + = green[y1 * 8 + 8 + x1 / 2]; + dest[((y + y1 + 1) * width + + x + x1 + 1)] + = blue[y1 * 4 + x1 / 2]; + } + } + } + jpeg_finish_decompress (&dinfo); + + /* Set jpeg_data_idx for the next stripe */ + jpeg_data_idx = (jpeg_data_idx + size + 0x0f) & ~0x0f; + } + jpeg_destroy_decompress(&dinfo); + return 0; +} diff -Nru v4l-utils-0.8.5/lib/libv4lconvert/jpeg.c v4l-utils-0.8.6/lib/libv4lconvert/jpeg.c --- v4l-utils-0.8.5/lib/libv4lconvert/jpeg.c 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4lconvert/jpeg.c 2012-02-10 19:58:53.000000000 +0000 @@ -41,7 +41,7 @@ if (tinyjpeg_parse_header(data->tinyjpeg, src, src_size)) { V4LCONVERT_ERR("parsing JPEG header: %s", tinyjpeg_get_errorstring(data->tinyjpeg)); - errno = EIO; + errno = EAGAIN; return -1; } tinyjpeg_get_size(data->tinyjpeg, &header_width, &header_height); @@ -266,8 +266,8 @@ unsigned int height = fmt->fmt.pix.height; int result = 0; - /* libjpeg errors before decoding the first line should signal EIO */ - data->jerr_errno = EIO; + /* libjpeg errors before decoding the first line should signal EAGAIN */ + data->jerr_errno = EAGAIN; result = setjmp(data->jerr_jmp_state); if (result) { if (data->cinfo_initialized) @@ -386,6 +386,7 @@ } data->cinfo.raw_data_out = TRUE; + data->cinfo.do_fancy_upsampling = FALSE; jpeg_start_decompress(&data->cinfo); /* Make libjpeg errors report that we've got some data */ data->jerr_errno = EPIPE; diff -Nru v4l-utils-0.8.5/lib/libv4lconvert/libv4lconvert.c v4l-utils-0.8.6/lib/libv4lconvert/libv4lconvert.c --- v4l-utils-0.8.5/lib/libv4lconvert/libv4lconvert.c 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4lconvert/libv4lconvert.c 2012-02-10 19:58:53.000000000 +0000 @@ -78,6 +78,7 @@ { V4L2_PIX_FMT_SN9C2028, 0, 9, 9, 1 }, { V4L2_PIX_FMT_PAC207, 0, 9, 9, 1 }, { V4L2_PIX_FMT_MR97310A, 0, 9, 9, 1 }, + { V4L2_PIX_FMT_JL2005BCD, 0, 9, 9, 1 }, { V4L2_PIX_FMT_SQ905C, 0, 9, 9, 1 }, /* special */ { V4L2_PIX_FMT_SE401, 0, 8, 9, 1 }, @@ -160,8 +161,10 @@ free(data); return NULL; } - data->control_flags = v4lcontrol_get_flags(data->control); data->bandwidth = v4lcontrol_get_bandwidth(data->control); + data->control_flags = v4lcontrol_get_flags(data->control); + if (data->control_flags & V4LCONTROL_FORCE_TINYJPEG) + data->flags |= V4LCONVERT_USE_TINYJPEG; data->processing = v4lprocessing_create(fd, data->control); if (!data->processing) { @@ -577,6 +580,7 @@ case V4L2_PIX_FMT_SN9C10X: case V4L2_PIX_FMT_PAC207: case V4L2_PIX_FMT_MR97310A: + case V4L2_PIX_FMT_JL2005BCD: case V4L2_PIX_FMT_SN9C2028: case V4L2_PIX_FMT_SQ905C: case V4L2_PIX_FMT_SBGGR8: @@ -773,6 +777,7 @@ case V4L2_PIX_FMT_SN9C10X: case V4L2_PIX_FMT_PAC207: case V4L2_PIX_FMT_MR97310A: + case V4L2_PIX_FMT_JL2005BCD: case V4L2_PIX_FMT_SN9C2028: case V4L2_PIX_FMT_SQ905C: case V4L2_PIX_FMT_STV0680: { /* Not compressed but needs some shuffling */ @@ -811,6 +816,16 @@ } tmpfmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; break; + case V4L2_PIX_FMT_JL2005BCD: + if (v4lconvert_decode_jl2005bcd(data, src, src_size, + tmpbuf, + width, height)) { + /* Corrupt frame, better get another one */ + errno = EAGAIN; + return -1; + } + tmpfmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SRGGB8; + break; case V4L2_PIX_FMT_SN9C2028: v4lconvert_decode_sn9c2028(src, tmpbuf, width, height); tmpfmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8; diff -Nru v4l-utils-0.8.5/lib/libv4lconvert/libv4lconvert-priv.h v4l-utils-0.8.6/lib/libv4lconvert/libv4lconvert-priv.h --- v4l-utils-0.8.5/lib/libv4lconvert/libv4lconvert-priv.h 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4lconvert/libv4lconvert-priv.h 2012-02-10 19:58:53.000000000 +0000 @@ -216,6 +216,10 @@ const unsigned char *src, int src_size, unsigned char *dst, int width, int height); +int v4lconvert_decode_jl2005bcd(struct v4lconvert_data *data, + const unsigned char *src, int src_size, + unsigned char *dest, int width, int height); + void v4lconvert_decode_sn9c2028(const unsigned char *src, unsigned char *dst, int width, int height); diff -Nru v4l-utils-0.8.5/lib/libv4lconvert/Makefile v4l-utils-0.8.6/lib/libv4lconvert/Makefile --- v4l-utils-0.8.5/lib/libv4lconvert/Makefile 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4lconvert/Makefile 2012-02-10 19:58:53.000000000 +0000 @@ -10,6 +10,7 @@ endif CONVERT_OBJS = libv4lconvert.o tinyjpeg.o sn9c10x.o sn9c20x.o pac207.o \ + jl2005bcd.o \ mr97310a.o flip.o crop.o jidctflt.o spca561-decompress.o \ rgbyuv.o sn9c2028-decomp.o spca501.o sq905c.o bayer.o hm12.o \ stv0680.o cpia1.o se401.o jpgl.o jpeg.o jpeg_memsrcdest.o \ diff -Nru v4l-utils-0.8.5/lib/libv4lconvert/processing/whitebalance.c v4l-utils-0.8.6/lib/libv4lconvert/processing/whitebalance.c --- v4l-utils-0.8.5/lib/libv4lconvert/processing/whitebalance.c 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/lib/libv4lconvert/processing/whitebalance.c 2012-02-10 19:58:53.000000000 +0000 @@ -47,7 +47,8 @@ struct v4lprocessing_data *data, int green_avg, int comp1_avg, int comp2_avg) { int i, avg_avg; - const int max_step = 64; + const int threshold = 64; + const int max_step = 128; /* Clip averages (restricts maximum white balance correction) */ green_avg = CLIP(green_avg, 512, 3072); @@ -60,13 +61,16 @@ data->comp1_avg = comp1_avg; data->comp2_avg = comp2_avg; } else { - /* Slowly adjust the averages used for the correction, so that we - do not get a sudden change in colors */ + /* Slowly adjust the averages used for the correction, so that + we do not get a sudden change in colors */ + int throttling = 0; + if (abs(data->green_avg - green_avg) > max_step) { if (data->green_avg < green_avg) data->green_avg += max_step; else data->green_avg -= max_step; + throttling = 1; } else data->green_avg = green_avg; @@ -75,6 +79,7 @@ data->comp1_avg += max_step; else data->comp1_avg -= max_step; + throttling = 1; } else data->comp1_avg = comp1_avg; @@ -83,13 +88,25 @@ data->comp2_avg += max_step; else data->comp2_avg -= max_step; + throttling = 1; } else data->comp2_avg = comp2_avg; + + /* + * If we are still converging to a stable update situation, + * re-calc the lookup tables next frame, but only if no + * other processing plugin has already asked for a shorter + * update cycle, as asking for an update each frame while + * some other pluging is trying to adjust hw settings is bad. + */ + if (throttling && data->lookup_table_update_counter == 0) + data->lookup_table_update_counter = + V4L2PROCESSING_UPDATE_RATE; } - if (abs(data->green_avg - data->comp1_avg) < max_step && - abs(data->green_avg - data->comp2_avg) < max_step && - abs(data->comp1_avg - data->comp2_avg) < max_step) + if (abs(data->green_avg - data->comp1_avg) < threshold && + abs(data->green_avg - data->comp2_avg) < threshold && + abs(data->comp1_avg - data->comp2_avg) < threshold) return 0; avg_avg = (data->green_avg + data->comp1_avg + data->comp2_avg) / 3; diff -Nru v4l-utils-0.8.5/Make.rules v4l-utils-0.8.6/Make.rules --- v4l-utils-0.8.5/Make.rules 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/Make.rules 2012-02-10 19:58:53.000000000 +0000 @@ -1,4 +1,4 @@ -V4L_UTILS_VERSION=0.8.5 +V4L_UTILS_VERSION=0.8.6 # These ones can be overriden from the cmdline diff -Nru v4l-utils-0.8.5/utils/keytable/ir-keytable.1 v4l-utils-0.8.6/utils/keytable/ir-keytable.1 --- v4l-utils-0.8.5/utils/keytable/ir-keytable.1 2011-07-17 16:06:39.000000000 +0000 +++ v4l-utils-0.8.6/utils/keytable/ir-keytable.1 2012-02-10 19:58:53.000000000 +0000 @@ -11,7 +11,7 @@ .B ir\-keytable [\fIOPTION\fR]... [\fIfor using the rc0 sysdev\fR] .SH DESCRIPTION -ir\-keytable is a tool that lists the Remote Controller devices, allows to +ir\-keytable is a tool that lists the Remote Controller devices, allows one to get/set IR keycode/scancode tables, test events generated by IR, and to adjust other Remote Controller options. .PP