[PATCH] jpeg_memsrcdest: extend feature check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

Signed-off-by: Patrick Ohly <patrick.ohly@xxxxxxxxx>
---
 lib/libv4lconvert/jpeg_memsrcdest.c | 4 ++--
 lib/libv4lconvert/jpeg_memsrcdest.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/libv4lconvert/jpeg_memsrcdest.c b/lib/libv4lconvert/jpeg_memsrcdest.c
index 323e7af..578c465 100644
--- a/lib/libv4lconvert/jpeg_memsrcdest.c
+++ b/lib/libv4lconvert/jpeg_memsrcdest.c
@@ -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 */
 
diff --git a/lib/libv4lconvert/jpeg_memsrcdest.h b/lib/libv4lconvert/jpeg_memsrcdest.h
index 28a6477..b13bf3f 100644
--- a/lib/libv4lconvert/jpeg_memsrcdest.h
+++ b/lib/libv4lconvert/jpeg_memsrcdest.h
@@ -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,
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux