diff options
-rw-r--r-- | server/display-channel.c | 2 | ||||
-rw-r--r-- | server/display-channel.h | 2 | ||||
-rw-r--r-- | server/red_worker.c | 5 |
3 files changed, 4 insertions, 5 deletions
diff --git a/server/display-channel.c b/server/display-channel.c index c922b55f..6ccb5531 100644 --- a/server/display-channel.c +++ b/server/display-channel.c @@ -159,6 +159,8 @@ DisplayChannelClient *dcc_new(DisplayChannel *display, dcc->image_compression = image_compression; dcc->jpeg_state = jpeg_state; dcc->zlib_glz_state = zlib_glz_state; + // todo: tune quality according to bandwidth + dcc->jpeg_quality = 85; return dcc; } diff --git a/server/display-channel.h b/server/display-channel.h index 3570742c..f7086063 100644 --- a/server/display-channel.h +++ b/server/display-channel.h @@ -167,6 +167,7 @@ struct DisplayChannelClient { SpiceImageCompression image_compression; spice_wan_compression_t jpeg_state; spice_wan_compression_t zlib_glz_state; + int jpeg_quality; int expect_init; @@ -325,7 +326,6 @@ struct DisplayChannel { uint32_t renderers[RED_RENDERER_LAST]; uint32_t renderer; int enable_jpeg; - int jpeg_quality; int enable_zlib_glz_wrap; int zlib_level; diff --git a/server/red_worker.c b/server/red_worker.c index d63bf24f..0bb79e6c 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -3221,7 +3221,7 @@ static int red_jpeg_compress_image(DisplayChannelClient *dcc, SpiceImage *dest, jpeg_data->data.u.lines_data.reverse = 1; stride = -src->stride; } - jpeg_size = jpeg_encode(jpeg, display_channel->jpeg_quality, jpeg_in_type, + jpeg_size = jpeg_encode(jpeg, dcc->jpeg_quality, jpeg_in_type, src->x, src->y, NULL, 0, stride, jpeg_data->data.bufs_head->buf, sizeof(jpeg_data->data.bufs_head->buf)); @@ -7399,9 +7399,6 @@ static void handle_new_display_channel(RedWorker *worker, RedClient *client, Red display_channel->enable_jpeg = (dcc->jpeg_state == SPICE_WAN_COMPRESSION_ALWAYS); } - // todo: tune quality according to bandwidth - display_channel->jpeg_quality = 85; - if (dcc->zlib_glz_state == SPICE_WAN_COMPRESSION_AUTO) { display_channel->enable_zlib_glz_wrap = dcc->common.is_low_bandwidth; } else { |