[Spice-devel] [PATCH 3/3] Display: Send a preferred compression message on init.
Javier Celaya
javier.celaya at flexvm.es
Fri Apr 17 03:40:25 PDT 2015
If the user prefers a specific compression algorithm, report it when
setting up the display channel.
---
gtk/channel-display.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/gtk/channel-display.c b/gtk/channel-display.c
index efe2259..6f5fb5f 100644
--- a/gtk/channel-display.c
+++ b/gtk/channel-display.c
@@ -789,12 +789,14 @@ 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;
g_object_get(s,
"cache-size", &cache_size,
"glz-window-size", &glz_window_size,
+ "preferred-compression", &pref_comp_msg.image_compression,
NULL);
CHANNEL_DEBUG(channel, "%s: cache_size %d, glz_window_size %d (bytes)", __FUNCTION__,
cache_size, glz_window_size);
@@ -810,6 +812,12 @@ 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 (pref_comp_msg.image_compression != SPICE_IMAGE_COMPRESS_INVALID) {
+ 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) { \
--
1.9.3
More information about the Spice-devel
mailing list