[Spice-commits] server/reds.c server/reds.h server/reds-private.h server/red-worker.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Tue Feb 2 15:59:37 UTC 2016
server/red-worker.c | 2 +-
server/reds-private.h | 1 +
server/reds.c | 9 +++++++--
server/reds.h | 2 +-
4 files changed, 10 insertions(+), 4 deletions(-)
New commits:
commit da6618681c0926003df2f197d60c541285dbfa37
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Tue Jan 27 14:15:07 2015 -0600
Move jpeg_state to RedsState struct
Also required adding reds_get_jpeg_state() for external access.
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/red-worker.c b/server/red-worker.c
index f98b2f4..f6c4f45 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -1507,7 +1507,7 @@ RedWorker* red_worker_new(QXLInstance *qxl, RedDispatcher *red_dispatcher)
}
worker->image_compression = spice_server_get_image_compression(reds);
- worker->jpeg_state = jpeg_state;
+ worker->jpeg_state = reds_get_jpeg_state(reds);
worker->zlib_glz_state = zlib_glz_state;
worker->driver_cap_monitors_config = 0;
#ifdef RED_STATISTICS
diff --git a/server/reds-private.h b/server/reds-private.h
index fd2aa10..9028f6a 100644
--- a/server/reds-private.h
+++ b/server/reds-private.h
@@ -215,6 +215,7 @@ struct RedsState {
uint8_t spice_uuid[16];
SpiceImageCompression image_compression;
+ spice_wan_compression_t jpeg_state;
};
#endif
diff --git a/server/reds.c b/server/reds.c
index 74dd033..9ec80f2 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -148,7 +148,6 @@ static int ticketing_enabled = 1; //Ticketing is enabled by default
static pthread_mutex_t *lock_cs;
static long *lock_count;
uint32_t streaming_video = SPICE_STREAM_VIDEO_FILTER;
-spice_wan_compression_t jpeg_state = SPICE_WAN_COMPRESSION_AUTO;
spice_wan_compression_t zlib_glz_state = SPICE_WAN_COMPRESSION_AUTO;
int agent_mouse = TRUE;
int agent_copypaste = TRUE;
@@ -3422,6 +3421,7 @@ SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
reds->spice_uuid_is_set = FALSE;
memset(reds->spice_uuid, 0, sizeof(reds->spice_uuid));
reds->image_compression = SPICE_IMAGE_COMPRESSION_AUTO_GLZ;
+ reds->jpeg_state = SPICE_WAN_COMPRESSION_AUTO;
return reds;
}
@@ -3686,7 +3686,7 @@ SPICE_GNUC_VISIBLE int spice_server_set_jpeg_compression(SpiceServer *s, spice_w
return -1;
}
// todo: support dynamically changing the state
- jpeg_state = comp;
+ s->jpeg_state = comp;
return 0;
}
@@ -4008,3 +4008,8 @@ SPICE_GNUC_VISIBLE void spice_server_set_keepalive_timeout(SpiceServer *s, int t
reds->keepalive_timeout = timeout;
spice_debug("keepalive timeout=%d", timeout);
}
+
+spice_wan_compression_t reds_get_jpeg_state(const RedsState *reds)
+{
+ return reds->jpeg_state;
+}
diff --git a/server/reds.h b/server/reds.h
index 27bf90b..0cc6ec7 100644
--- a/server/reds.h
+++ b/server/reds.h
@@ -75,7 +75,6 @@ extern uint32_t num_renderers;
extern struct SpiceCoreInterfaceInternal *core;
extern uint32_t streaming_video;
-extern spice_wan_compression_t jpeg_state;
extern spice_wan_compression_t zlib_glz_state;
// Temporary measures to make splitting reds.c to inputs-channel.c easier
@@ -113,5 +112,6 @@ void reds_on_main_channel_migrate(RedsState *reds, MainChannelClient *mcc);
void reds_on_char_device_state_destroy(RedsState *reds, SpiceCharDeviceState *dev);
void reds_set_client_mm_time_latency(RedsState *reds, RedClient *client, uint32_t latency);
+spice_wan_compression_t reds_get_jpeg_state(const RedsState *reds);
#endif
More information about the Spice-commits
mailing list