aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-08-02 11:30:23 (GMT)
committerHans de Goede <hdegoede@redhat.com>2011-08-02 11:32:09 (GMT)
commit7eb5fdd4536019ac8afe50a23e96d9e56aa9c82d (patch)
tree1dbb58928180da07874efc7f5a5842a76314e4d9
parent1a4b8075216b822b515b84ea27f2a7aebff0e7df (diff)
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 <hdegoede@redhat.com>
-rw-r--r--lib/libv4lconvert/control/libv4lcontrol.c3
-rw-r--r--lib/libv4lconvert/control/libv4lcontrol.h1
-rw-r--r--lib/libv4lconvert/libv4lconvert.c4
3 files changed, 7 insertions, 1 deletions
diff --git a/lib/libv4lconvert/control/libv4lcontrol.c b/lib/libv4lconvert/control/libv4lcontrol.c
index ca6c798..5bbb42b 100644
--- a/lib/libv4lconvert/control/libv4lcontrol.c
+++ b/lib/libv4lconvert/control/libv4lcontrol.c
@@ -640,6 +640,9 @@ static const struct v4lcontrol_flags_info v4lcontrol_flags[] = {
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[];
diff --git a/lib/libv4lconvert/control/libv4lcontrol.h b/lib/libv4lconvert/control/libv4lcontrol.h
index 3d1a28d..00ffb34 100644
--- a/lib/libv4lconvert/control/libv4lcontrol.h
+++ b/lib/libv4lconvert/control/libv4lcontrol.h
@@ -30,6 +30,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 --git a/lib/libv4lconvert/libv4lconvert.c b/lib/libv4lconvert/libv4lconvert.c
index cf0b0f1..6a6a5f5 100644
--- a/lib/libv4lconvert/libv4lconvert.c
+++ b/lib/libv4lconvert/libv4lconvert.c
@@ -166,8 +166,10 @@ struct v4lconvert_data *v4lconvert_create(int fd, void *dev_ops_priv,
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) {

Privacy Policy