[Spice-devel] [PATCH] mjpeg_encoder: allocate "row" on demand
Christophe Fergeau
cfergeau at redhat.com
Wed Jul 13 02:09:56 PDT 2011
Hi,
On Tue, Jul 12, 2011 at 07:46:33PM +0200, Andrea Celestino wrote:
> Which version of libjpeg I should use? If I use libjpeg8, I receive this
> compile error:
>
> >mjpeg_encoder.c:178:13: error: static declaration of 'jpeg_mem_dest'
> follows non-static declaration
> >/usr/include/jpeglib.h:956:14: note: previous declaration of
> 'jpeg_mem_dest' was here
The attached patch should fix this (I already sent an email about this, but
not sure it went through, so I'm resending)
Christophe
-------------- next part --------------
From 453ce4b26086980143803b9356f6b3c1dcf1b3b2 Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <cfergeau at redhat.com>
Date: Wed, 13 Jul 2011 11:05:02 +0200
Subject: [PATCH] mjpeg: rename jpeg_mem_dest
jpeg_mem_dest is a public symbol in libjpeg8 so using it with
no prefix will cause symbol clashes. Rename it to spice_jpeg_mem_dest.
---
server/mjpeg_encoder.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/mjpeg_encoder.c b/server/mjpeg_encoder.c
index ed242db..ea2e15f 100644
--- a/server/mjpeg_encoder.c
+++ b/server/mjpeg_encoder.c
@@ -163,8 +163,8 @@ static void term_mem_destination(j_compress_ptr cinfo)
*/
static void
-jpeg_mem_dest (j_compress_ptr cinfo,
- unsigned char ** outbuffer, unsigned long * outsize)
+spice_jpeg_mem_dest(j_compress_ptr cinfo,
+ unsigned char ** outbuffer, unsigned long * outsize)
{
mem_destination_mgr *dest;
#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */
@@ -241,7 +241,7 @@ int mjpeg_encoder_start_frame(MJpegEncoder *encoder, SpiceBitmapFmt format,
encoder->row = spice_malloc(stride);
}
- jpeg_mem_dest(&encoder->cinfo, dest, dest_len);
+ spice_jpeg_mem_dest(&encoder->cinfo, dest, dest_len);
encoder->cinfo.image_width = encoder->width;
encoder->cinfo.image_height = encoder->height;
--
1.7.6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110713/382ea9a5/attachment.pgp>
More information about the Spice-devel
mailing list