GUACAMOLE-1302: Add VNC support for forcing lossless compression.

This commit is contained in:
Michael Jumper 2021-03-01 17:39:29 -08:00
parent 27f8403178
commit c2b7e2d039
3 changed files with 23 additions and 0 deletions

View File

@ -91,6 +91,8 @@ const char* GUAC_VNC_CLIENT_ARGS[] = {
"wol-broadcast-addr", "wol-broadcast-addr",
"wol-udp-port", "wol-udp-port",
"wol-wait-time", "wol-wait-time",
"force-lossless",
NULL NULL
}; };
@ -373,6 +375,12 @@ enum VNC_ARGS_IDX {
*/ */
IDX_WOL_WAIT_TIME, IDX_WOL_WAIT_TIME,
/**
* "true" if all graphical updates for this connection should use lossless
* compresion only, "false" or blank otherwise.
*/
IDX_FORCE_LOSSLESS,
VNC_ARGS_COUNT VNC_ARGS_COUNT
}; };
@ -432,6 +440,11 @@ guac_vnc_settings* guac_vnc_parse_args(guac_user* user,
guac_user_parse_args_int(user, GUAC_VNC_CLIENT_ARGS, argv, guac_user_parse_args_int(user, GUAC_VNC_CLIENT_ARGS, argv,
IDX_COLOR_DEPTH, 0); IDX_COLOR_DEPTH, 0);
/* Lossless compression */
settings->lossless =
guac_user_parse_args_boolean(user, GUAC_VNC_CLIENT_ARGS, argv,
IDX_FORCE_LOSSLESS, false);
#ifdef ENABLE_VNC_REPEATER #ifdef ENABLE_VNC_REPEATER
/* Set repeater parameters if specified */ /* Set repeater parameters if specified */
settings->dest_host = settings->dest_host =

View File

@ -77,6 +77,12 @@ typedef struct guac_vnc_settings {
*/ */
bool read_only; bool read_only;
/**
* Whether all graphical updates for this connection should use lossless
* compression only.
*/
bool lossless;
#ifdef ENABLE_VNC_REPEATER #ifdef ENABLE_VNC_REPEATER
/** /**
* The VNC host to connect to, if using a repeater. * The VNC host to connect to, if using a repeater.

View File

@ -435,6 +435,10 @@ void* guac_vnc_client_thread(void* data) {
vnc_client->display = guac_common_display_alloc(client, vnc_client->display = guac_common_display_alloc(client,
rfb_client->width, rfb_client->height); rfb_client->width, rfb_client->height);
/* Use lossless compression only if requested (otherwise, use default
* heuristics) */
guac_common_display_set_lossless(vnc_client->display, settings->lossless);
/* If not read-only, set an appropriate cursor */ /* If not read-only, set an appropriate cursor */
if (settings->read_only == 0) { if (settings->read_only == 0) {
if (settings->remote_cursor) if (settings->remote_cursor)