[Spice-commits] 2 commits - server/red_dispatcher.c server/red_dispatcher.h server/red_worker.c server/red_worker.h server/reds.c server/spice-server.h spice-common
Christophe Fergau
teuf at kemper.freedesktop.org
Tue Jun 30 07:49:50 PDT 2015
server/red_dispatcher.c | 2 +-
server/red_dispatcher.h | 2 +-
server/red_worker.c | 33 +++++++++++++++++++++++++++++----
server/red_worker.h | 2 +-
server/reds.c | 8 ++++----
server/spice-server.h | 16 ++++------------
spice-common | 2 +-
7 files changed, 41 insertions(+), 24 deletions(-)
New commits:
commit c914e96fb4de3ba8b2df174d7c7af8ff76af1081
Author: Javier Celaya <javier.celaya at flexvm.es>
Date: Fri Apr 17 12:40:48 2015 +0200
Handle preferred image compression messages
diff --git a/server/red_worker.c b/server/red_worker.c
index 9237786..1071716 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -10266,6 +10266,27 @@ static int display_channel_handle_stream_report(DisplayChannelClient *dcc,
return TRUE;
}
+static int display_channel_handle_preferred_compression(DisplayChannelClient *dcc,
+ SpiceMsgcDisplayPreferredCompression *pc) {
+ DisplayChannel *display_channel = DCC_TO_DC(dcc);
+ switch (pc->image_compression) {
+ case SPICE_IMAGE_COMPRESS_AUTO_LZ:
+ case SPICE_IMAGE_COMPRESS_AUTO_GLZ:
+ case SPICE_IMAGE_COMPRESS_QUIC:
+#ifdef USE_LZ4
+ case SPICE_IMAGE_COMPRESS_LZ4:
+#endif
+ case SPICE_IMAGE_COMPRESS_LZ:
+ case SPICE_IMAGE_COMPRESS_GLZ:
+ case SPICE_IMAGE_COMPRESS_OFF:
+ display_channel->common.worker->image_compression = pc->image_compression;
+ return TRUE;
+ default:
+ spice_warning("preferred-compression: unsupported image compression setting");
+ return FALSE;
+ }
+}
+
static int display_channel_handle_message(RedChannelClient *rcc, uint32_t size, uint16_t type,
void *message)
{
@@ -10282,6 +10303,10 @@ static int display_channel_handle_message(RedChannelClient *rcc, uint32_t size,
case SPICE_MSGC_DISPLAY_STREAM_REPORT:
return display_channel_handle_stream_report(dcc,
(SpiceMsgcDisplayStreamReport *)message);
+ case SPICE_MSGC_DISPLAY_PREFERRED_COMPRESSION:
+ return display_channel_handle_preferred_compression(dcc,
+ (SpiceMsgcDisplayPreferredCompression *)message);
+
default:
return red_channel_client_handle_message(rcc, size, type, message);
}
commit 22c40b9d1fadc7892580aeb831514a81320e7b76
Author: Javier Celaya <javier.celaya at flexvm.es>
Date: Fri Apr 17 12:40:47 2015 +0200
Use image compress constants from spice-protocol
diff --git a/server/red_dispatcher.c b/server/red_dispatcher.c
index a2ef226..faa0d76 100644
--- a/server/red_dispatcher.c
+++ b/server/red_dispatcher.c
@@ -70,7 +70,7 @@ struct RedDispatcher {
};
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 70b8a62..b29cb8b 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 061b990..9237786 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -986,7 +986,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;
@@ -6557,7 +6557,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;
@@ -6869,7 +6869,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);
@@ -8815,7 +8815,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 56e87a2..0867edb 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 = SPICE_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;
@@ -2709,7 +2709,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;
@@ -3552,7 +3552,7 @@ 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);
#ifndef USE_LZ4
@@ -3567,7 +3567,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_image_compression(SpiceServer *s,
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-server.h b/server/spice-server.h
index bca0da6..0c707a7 100644
--- a/server/spice-server.h
+++ b/server/spice-server.h
@@ -67,20 +67,12 @@ 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_COMPRESS_LZ4 = 7,
-} spice_image_compression_t;
+// Needed for backward API compatibility
+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 b/spice-common
index 1b5edbe..dcebede 160000
--- a/spice-common
+++ b/spice-common
@@ -1 +1 @@
-Subproject commit 1b5edbe49e5c36c4f35453de448b54f770e1c1be
+Subproject commit dcebede0ca3d012786b9ab8fd95961c637b0b4a7
More information about the Spice-commits
mailing list