From: Hans de Goede <hdegoede@redhat.com>
To: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
linux-media@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCH v4l-utils] libv4lconvert: only expose jpeg_mem_*() protoypes when JPEG_LIB_VERSION < 80
Date: Thu, 21 Jan 2016 12:00:22 +0100 [thread overview]
Message-ID: <56A0BA46.5020106@redhat.com> (raw)
In-Reply-To: <1453369987-12428-1-git-send-email-thomas.petazzoni@free-electrons.com>
Hi,
On 21-01-16 10:53, Thomas Petazzoni wrote:
> 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>
Thanks, applied and pushed,
Regards,
Hans
> ---
> 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
>
prev parent reply other threads:[~2016-01-21 11:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-21 9:53 [PATCH v4l-utils] libv4lconvert: only expose jpeg_mem_*() protoypes when JPEG_LIB_VERSION < 80 Thomas Petazzoni
2016-01-21 11:00 ` Hans de Goede [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56A0BA46.5020106@redhat.com \
--to=hdegoede@redhat.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=hans.verkuil@cisco.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
--cc=thomas.petazzoni@free-electrons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.