Skip to contentSkip to conversation

jpeg_memsrcdest: extend feature check

PATCH New Patrick Ohly 1 participant 1 message Jun 15, 2016 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 jpeg_memsrcdest: extend feature check

libjpeg.h in OpenEmbedded master (from libjpeg-turbo 1.5.0) provides these methods if "JPEG_LIB_VERSION >= 80 || defined(MEM_SRCDST_SUPPORTED)".

The support for the jpeg_mem functions was added even when not emulating the libjpeg8 API, controlled via the MEM_SRCDST_SUPPORTED define, so checking for the version alone is not enough anymore.

See https://github.com/libjpeg-turbo/libjpeg-turbo/commit/ab70623eb29e09e67222be5b9e1ea320fe5aa0e9

This fixes errors about conflicting declarations (signed vs. unsigned char).

---
 lib/libv4lconvert/jpeg_memsrcdest.c | 4 ++--
 lib/libv4lconvert/jpeg_memsrcdest.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
lib/libv4lconvert/jpeg_memsrcdest.c +2 -2
index 323e7af..578c465 100644
@@ -30,8 +30,8 @@
 #include "jpeg_memsrcdest.h"
 
 /* libjpeg8 and later come with their own (API compatible) memory source
-   and dest */
-#if JPEG_LIB_VERSION < 80
+   and dest, and older versions may have it backported */
+#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)
 
 /* Expanded data source object for memory input */
 
lib/libv4lconvert/jpeg_memsrcdest.h +1 -1
index 28a6477..b13bf3f 100644
@@ -1,6 +1,6 @@
 #include <jpeglib.h>
 
-#if JPEG_LIB_VERSION < 80
+#if JPEG_LIB_VERSION < 80 && !defined(MEM_SRCDST_SUPPORTED)
 
 void
 jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
Signature · 1 line
2.1.4