diff --git a/0003-Use-image-compress-constants-from-spice-protocol.patch b/0003-Use-image-compress-constants-from-spice-protocol.patch new file mode 100644 index 0000000..384d3cf --- /dev/null +++ b/0003-Use-image-compress-constants-from-spice-protocol.patch @@ -0,0 +1,183 @@ +From 554ff3d2fd5acdb6fd1d456afc47221675613c16 Mon Sep 17 00:00:00 2001 +From: Javier Celaya +Date: Fri, 17 Apr 2015 12:40:47 +0200 +Subject: [PATCH] Use image compress constants from spice-protocol + +--- + server/red_dispatcher.c | 2 +- + server/red_dispatcher.h | 2 +- + server/red_worker.c | 8 ++++---- + server/red_worker.h | 2 +- + server/reds.c | 8 ++++---- + server/spice.h | 14 +++----------- + spice-common/spice-protocol/spice/enums.h | 12 ++++++++++++ + 7 files changed, 26 insertions(+), 22 deletions(-) + +diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c +index fd6c2e1..9cb7c83 100644 +--- a/server/red_dispatcher.c ++++ b/server/red_dispatcher.c +@@ -79,7 +79,7 @@ typedef struct RedWorkeState { + } RedWorkeState; + + extern uint32_t streaming_video; +-extern spice_image_compression_t image_compression; ++extern SpiceImageCompress image_compression; + extern spice_wan_compression_t jpeg_state; + extern spice_wan_compression_t zlib_glz_state; + +diff --git a/server/red_dispatcher.h b/server/red_dispatcher.h +index 907b7c7..2a1b446 100644 +--- a/server/red_dispatcher.h ++++ b/server/red_dispatcher.h +@@ -167,7 +167,7 @@ typedef struct RedWorkerMessageLoadvmCommands { + } RedWorkerMessageLoadvmCommands; + + typedef struct RedWorkerMessageSetCompression { +- spice_image_compression_t image_compression; ++ SpiceImageCompress image_compression; + } RedWorkerMessageSetCompression; + + typedef struct RedWorkerMessageSetStreamingVideo { +diff --git a/server/red_worker.c b/server/red_worker.c +index 1871e13..bba93c1 100644 +--- a/server/red_worker.c ++++ b/server/red_worker.c +@@ -975,7 +975,7 @@ typedef struct RedWorker { + + ImageCache image_cache; + +- spice_image_compression_t image_compression; ++ SpiceImageCompress image_compression; + spice_wan_compression_t jpeg_state; + spice_wan_compression_t zlib_glz_state; + +@@ -6417,7 +6417,7 @@ static inline int red_compress_image(DisplayChannelClient *dcc, + compress_send_data_t* o_comp_data) + { + DisplayChannel *display_channel = DCC_TO_DC(dcc); +- spice_image_compression_t image_compression = ++ SpiceImageCompress image_compression = + display_channel->common.worker->image_compression; + int quic_compress = FALSE; + +@@ -6710,7 +6710,7 @@ static void fill_mask(RedChannelClient *rcc, SpiceMarshaller *m, + + if (mask_bitmap && m) { + if (display_channel->common.worker->image_compression != SPICE_IMAGE_COMPRESS_OFF) { +- spice_image_compression_t save_img_comp = ++ SpiceImageCompress save_img_comp = + display_channel->common.worker->image_compression; + display_channel->common.worker->image_compression = SPICE_IMAGE_COMPRESS_OFF; + fill_bits(dcc, m, mask_bitmap, drawable, FALSE); +@@ -8656,7 +8656,7 @@ static void red_marshall_image(RedChannelClient *rcc, SpiceMarshaller *m, ImageI + int comp_succeeded; + int lossy_comp = FALSE; + int lz_comp = FALSE; +- spice_image_compression_t comp_mode; ++ SpiceImageCompress comp_mode; + SpiceMsgDisplayDrawCopy copy; + SpiceMarshaller *src_bitmap_out, *mask_bitmap_out; + SpiceMarshaller *bitmap_palette_out, *lzplt_palette_out; +diff --git a/server/red_worker.h b/server/red_worker.h +index 272661f..2042b3d 100644 +--- a/server/red_worker.h ++++ b/server/red_worker.h +@@ -92,7 +92,7 @@ typedef struct WorkerInitData { + uint32_t *pending; + uint32_t num_renderers; + uint32_t renderers[RED_MAX_RENDERERS]; +- spice_image_compression_t image_compression; ++ SpiceImageCompress image_compression; + spice_wan_compression_t jpeg_state; + spice_wan_compression_t zlib_glz_state; + int streaming_video; +diff --git a/server/reds.c b/server/reds.c +index ed142ec..9350e50 100644 +--- a/server/reds.c ++++ b/server/reds.c +@@ -111,7 +111,7 @@ static int ticketing_enabled = 1; //Ticketing is enabled by default + static pthread_mutex_t *lock_cs; + static long *lock_count; + uint32_t streaming_video = STREAM_VIDEO_FILTER; +-spice_image_compression_t image_compression = SPICE_IMAGE_COMPRESS_AUTO_GLZ; ++SpiceImageCompress image_compression = SPICE_IMAGE_COMPRESS_AUTO_GLZ; + spice_wan_compression_t jpeg_state = SPICE_WAN_COMPRESSION_AUTO; + spice_wan_compression_t zlib_glz_state = SPICE_WAN_COMPRESSION_AUTO; + int agent_mouse = TRUE; +@@ -2628,7 +2628,7 @@ static inline void on_activating_ticketing(void) + } + } + +-static void set_image_compression(spice_image_compression_t val) ++static void set_image_compression(SpiceImageCompress val) + { + if (val == image_compression) { + return; +@@ -3485,14 +3485,14 @@ SPICE_GNUC_VISIBLE int spice_server_set_tls(SpiceServer *s, int port, + } + + SPICE_GNUC_VISIBLE int spice_server_set_image_compression(SpiceServer *s, +- spice_image_compression_t comp) ++ SpiceImageCompress comp) + { + spice_assert(reds == s); + set_image_compression(comp); + return 0; + } + +-SPICE_GNUC_VISIBLE spice_image_compression_t spice_server_get_image_compression(SpiceServer *s) ++SPICE_GNUC_VISIBLE SpiceImageCompress spice_server_get_image_compression(SpiceServer *s) + { + spice_assert(reds == s); + return image_compression; +diff --git a/server/spice.h b/server/spice.h +index 58700d1..e8ecdef 100644 +--- a/server/spice.h ++++ b/server/spice.h +@@ -471,19 +471,11 @@ int spice_server_add_interface(SpiceServer *s, + SpiceBaseInstance *sin); + int spice_server_remove_interface(SpiceBaseInstance *sin); + +-typedef enum { +- SPICE_IMAGE_COMPRESS_INVALID = 0, +- SPICE_IMAGE_COMPRESS_OFF = 1, +- SPICE_IMAGE_COMPRESS_AUTO_GLZ = 2, +- SPICE_IMAGE_COMPRESS_AUTO_LZ = 3, +- SPICE_IMAGE_COMPRESS_QUIC = 4, +- SPICE_IMAGE_COMPRESS_GLZ = 5, +- SPICE_IMAGE_COMPRESS_LZ = 6, +-} spice_image_compression_t; ++typedef SpiceImageCompress spice_image_compression_t; + + int spice_server_set_image_compression(SpiceServer *s, +- spice_image_compression_t comp); +-spice_image_compression_t spice_server_get_image_compression(SpiceServer *s); ++ SpiceImageCompress comp); ++SpiceImageCompress spice_server_get_image_compression(SpiceServer *s); + + typedef enum { + SPICE_WAN_COMPRESSION_INVALID, +diff --git a/spice-common/spice-protocol/spice/enums.h b/spice-common/spice-protocol/spice/enums.h +index 8de018f..60b6a52 100644 +--- a/spice-common/spice-protocol/spice/enums.h ++++ b/spice-common/spice-protocol/spice/enums.h +@@ -180,6 +180,18 @@ typedef enum SpiceImageType { + SPICE_IMAGE_TYPE_ENUM_END + } SpiceImageType; + ++typedef enum SpiceImageCompress { ++ SPICE_IMAGE_COMPRESS_INVALID = 0, ++ SPICE_IMAGE_COMPRESS_OFF = 1, ++ SPICE_IMAGE_COMPRESS_AUTO_GLZ = 2, ++ SPICE_IMAGE_COMPRESS_AUTO_LZ = 3, ++ SPICE_IMAGE_COMPRESS_QUIC = 4, ++ SPICE_IMAGE_COMPRESS_GLZ = 5, ++ SPICE_IMAGE_COMPRESS_LZ = 6, ++ ++ SPICE_IMAGE_COMPRESS_ENUM_END ++} SpiceImageCompress; ++ + typedef enum SpiceImageFlags { + SPICE_IMAGE_FLAGS_CACHE_ME = (1 << 0), + SPICE_IMAGE_FLAGS_HIGH_BITS_SET = (1 << 1),