summaryrefslogtreecommitdiff
path: root/server/display-channel.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-10-03 21:31:20 +0200
committerFrediano Ziglio <fziglio@redhat.com>2015-12-02 12:34:47 +0000
commit4980850dd2feea6a85b344addbe9baf005e1c229 (patch)
treebc1fba4b2578b2f0fffc43ec773c74ac7ad3e3e5 /server/display-channel.c
parent47b023866faac2c5e3302d4d3fc42a0260a5557c (diff)
display: add update_compression() method
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Diffstat (limited to 'server/display-channel.c')
-rw-r--r--server/display-channel.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/display-channel.c b/server/display-channel.c
index 29fa1bb4..2bf65a87 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1875,3 +1875,20 @@ exit:
red_put_surface_cmd(surface);
free(surface);
}
+
+void display_channel_update_compression(DisplayChannel *display, DisplayChannelClient *dcc)
+{
+ if (dcc->jpeg_state == SPICE_WAN_COMPRESSION_AUTO) {
+ display->enable_jpeg = dcc->common.is_low_bandwidth;
+ } else {
+ display->enable_jpeg = (dcc->jpeg_state == SPICE_WAN_COMPRESSION_ALWAYS);
+ }
+
+ if (dcc->zlib_glz_state == SPICE_WAN_COMPRESSION_AUTO) {
+ display->enable_zlib_glz_wrap = dcc->common.is_low_bandwidth;
+ } else {
+ display->enable_zlib_glz_wrap = (dcc->zlib_glz_state == SPICE_WAN_COMPRESSION_ALWAYS);
+ }
+ spice_info("jpeg %s", display->enable_jpeg ? "enabled" : "disabled");
+ spice_info("zlib-over-glz %s", display->enable_zlib_glz_wrap ? "enabled" : "disabled");
+}