* [Buildroot] [PATCH] libv4l: add patch to fix libjpeg build issue
@ 2016-01-21 9:52 Thomas Petazzoni
2016-01-21 10:47 ` Gustavo Zacarias
2016-01-21 14:27 ` Thomas Petazzoni
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-01-21 9:52 UTC (permalink / raw)
To: buildroot
Since the bump of libjpeg to v9b, libv4l doesn't build anymore due to
the change of the prototype of jpeg_mem_src(), which gets
re-implemented in libv4l when the libjpeg is too old.
Fixes:
http://autobuild.buildroot.org/results/e7a/e7a2341cbbcf514f4cd6754a5a36cebd6556a757/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
...rt-only-expose-jpeg_mem_-protoypes-when-J.patch | 53 ++++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 package/libv4l/0005-libv4lconvert-only-expose-jpeg_mem_-protoypes-when-J.patch
diff --git a/package/libv4l/0005-libv4lconvert-only-expose-jpeg_mem_-protoypes-when-J.patch b/package/libv4l/0005-libv4lconvert-only-expose-jpeg_mem_-protoypes-when-J.patch
new file mode 100644
index 0000000..d0d3624
--- /dev/null
+++ b/package/libv4l/0005-libv4lconvert-only-expose-jpeg_mem_-protoypes-when-J.patch
@@ -0,0 +1,53 @@
+From d468d1bba973999f2f1103ebaf7df5c8440a5499 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Date: Thu, 21 Jan 2016 10:22:16 +0100
+Subject: [PATCH] libv4lconvert: only expose jpeg_mem_*() protoypes when
+ JPEG_LIB_VERSION < 80
+
+The jpeg_memsrcdest.c file implements jpeg_mem_src() and
+jpeg_mem_dest() when JPEG_LIB_VERSION < 80 in order to provide those
+functions to libv4lconvert when the libjpeg library being used is too
+old.
+
+However, the jpeg_memsrcdest.h file exposes the prototypes of those
+functions unconditionally. Until now, the prototype was matching the
+one of the functions exposed by libjpeg (when JPEG_LIB_VERSION >= 80),
+so there was no problem.
+
+But since the release of libjpeg 9b (in January 2016), they changed
+the second argument of jpeg_mem_src() from "unsigned char *" to "const
+unsigned char*". Therefore, there are two prototypes for the
+jpeg_mem_src() function: one from libjpeg, one from libv4l, and they
+conflict with each other.
+
+To resolve this situation, this patch modifies jpeg_memsrcdest.h to
+only expose the prototypes when libv4l is implementing the functions
+(i.e when JPEG_LIB_VERSION < 80). When JPEG_LIB_VERSION >= 80, the
+prototypes will come from <jpeglib.h>.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ lib/libv4lconvert/jpeg_memsrcdest.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/lib/libv4lconvert/jpeg_memsrcdest.h b/lib/libv4lconvert/jpeg_memsrcdest.h
+index e971182..28a6477 100644
+--- a/lib/libv4lconvert/jpeg_memsrcdest.h
++++ b/lib/libv4lconvert/jpeg_memsrcdest.h
+@@ -1,5 +1,7 @@
+ #include <jpeglib.h>
+
++#if JPEG_LIB_VERSION < 80
++
+ void
+ jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
+ unsigned long bufsize);
+@@ -7,3 +9,5 @@ jpeg_mem_src (j_decompress_ptr cinfo, unsigned char * buffer,
+ void
+ jpeg_mem_dest (j_compress_ptr cinfo, unsigned char ** outbuffer,
+ unsigned long * outsize);
++
++#endif
+--
+2.6.4
+
--
2.6.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] libv4l: add patch to fix libjpeg build issue
2016-01-21 9:52 [Buildroot] [PATCH] libv4l: add patch to fix libjpeg build issue Thomas Petazzoni
@ 2016-01-21 10:47 ` Gustavo Zacarias
2016-01-21 14:27 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Gustavo Zacarias @ 2016-01-21 10:47 UTC (permalink / raw)
To: buildroot
On 21/01/16 06:52, Thomas Petazzoni wrote:
> Since the bump of libjpeg to v9b, libv4l doesn't build anymore due to
> the change of the prototype of jpeg_mem_src(), which gets
> re-implemented in libv4l when the libjpeg is too old.
>
> Fixes:
>
> http://autobuild.buildroot.org/results/e7a/e7a2341cbbcf514f4cd6754a5a36cebd6556a757/
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Tested-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
(test via broken jpeg and working jpeg-turbo builds before patching,
then patching, then both builds work).
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] libv4l: add patch to fix libjpeg build issue
2016-01-21 9:52 [Buildroot] [PATCH] libv4l: add patch to fix libjpeg build issue Thomas Petazzoni
2016-01-21 10:47 ` Gustavo Zacarias
@ 2016-01-21 14:27 ` Thomas Petazzoni
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-01-21 14:27 UTC (permalink / raw)
To: buildroot
Hello,
On Thu, 21 Jan 2016 10:52:02 +0100, Thomas Petazzoni wrote:
> Since the bump of libjpeg to v9b, libv4l doesn't build anymore due to
> the change of the prototype of jpeg_mem_src(), which gets
> re-implemented in libv4l when the libjpeg is too old.
>
> Fixes:
>
> http://autobuild.buildroot.org/results/e7a/e7a2341cbbcf514f4cd6754a5a36cebd6556a757/
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> ...rt-only-expose-jpeg_mem_-protoypes-when-J.patch | 53 ++++++++++++++++++++++
> 1 file changed, 53 insertions(+)
> create mode 100644 package/libv4l/0005-libv4lconvert-only-expose-jpeg_mem_-protoypes-when-J.patch
Applied, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-21 14:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-21 9:52 [Buildroot] [PATCH] libv4l: add patch to fix libjpeg build issue Thomas Petazzoni
2016-01-21 10:47 ` Gustavo Zacarias
2016-01-21 14:27 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox