summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Celaya <javier.celaya@flexvdi.com>2015-06-03 17:07:52 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2015-06-29 15:22:53 +0200
commitdca252cf622ffe38ede19bfe44bbc81c2a4ef289 (patch)
tree93ca5570dfdb491e50e8c272ca765d3006dd0a39
parentf3803e0ad12f05b8f3da941c19cda3e153da1ea1 (diff)
Display: Send a preferred compression message on init.
If the user prefers a specific compression algorithm, report it when setting up the display channel.
-rw-r--r--src/channel-display.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/channel-display.c b/src/channel-display.c
index efe2259..5dd3f71 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -789,12 +789,15 @@ static void spice_display_channel_up(SpiceChannel *channel)
SpiceMsgOut *out;
SpiceSession *s = spice_channel_get_session(channel);
SpiceMsgcDisplayInit init;
+ SpiceMsgcDisplayPreferredCompression pref_comp_msg;
int cache_size;
int glz_window_size;
+ SpiceImageCompress preferred_compression = SPICE_IMAGE_COMPRESS_INVALID;
g_object_get(s,
"cache-size", &cache_size,
"glz-window-size", &glz_window_size,
+ "preferred-compression", &preferred_compression,
NULL);
CHANNEL_DEBUG(channel, "%s: cache_size %d, glz_window_size %d (bytes)", __FUNCTION__,
cache_size, glz_window_size);
@@ -810,6 +813,14 @@ static void spice_display_channel_up(SpiceChannel *channel)
this monitor */
if (channel->priv->channel_id != 0)
g_coroutine_object_notify(G_OBJECT(channel), "monitors");
+
+ if (spice_channel_test_capability(channel, SPICE_DISPLAY_CAP_PREF_COMPRESSION) &&
+ preferred_compression > SPICE_IMAGE_COMPRESS_INVALID) {
+ pref_comp_msg.image_compression = preferred_compression;
+ out = spice_msg_out_new(channel, SPICE_MSGC_DISPLAY_PREFERRED_COMPRESSION);
+ out->marshallers->msgc_display_preferred_compression(out->marshaller, &pref_comp_msg);
+ spice_msg_out_send_internal(out);
+ }
}
#define DRAW(type) { \