mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-27 07:29:32 +00:00
Move streaming_video to RedsState struct
Also requires adding reds_get_streaming_video() accessor so that other files can check this value. Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
df7ba60503
commit
e7e42f4126
@ -704,8 +704,9 @@ static void qxl_worker_loadvm_commands(QXLWorker *qxl_worker,
|
||||
|
||||
static inline int calc_compression_level(void)
|
||||
{
|
||||
spice_assert(streaming_video != SPICE_STREAM_VIDEO_INVALID);
|
||||
if ((streaming_video != SPICE_STREAM_VIDEO_OFF) ||
|
||||
spice_assert(reds_get_streaming_video(reds) != SPICE_STREAM_VIDEO_INVALID);
|
||||
|
||||
if ((reds_get_streaming_video(reds) != SPICE_STREAM_VIDEO_OFF) ||
|
||||
(spice_server_get_image_compression(reds) != SPICE_IMAGE_COMPRESSION_QUIC)) {
|
||||
return 0;
|
||||
} else {
|
||||
@ -736,7 +737,7 @@ void red_dispatcher_on_sv_change(void)
|
||||
RedDispatcher *now = dispatchers;
|
||||
while (now) {
|
||||
now->qxl->st->qif->set_compression_level(now->qxl, compression_level);
|
||||
payload.streaming_video = streaming_video;
|
||||
payload.streaming_video = reds_get_streaming_video(reds);
|
||||
dispatcher_send_message(&now->dispatcher,
|
||||
RED_WORKER_MESSAGE_SET_STREAMING_VIDEO,
|
||||
&payload);
|
||||
|
||||
@ -1542,7 +1542,7 @@ RedWorker* red_worker_new(QXLInstance *qxl, RedDispatcher *red_dispatcher)
|
||||
|
||||
worker->cursor_channel = cursor_channel_new(worker);
|
||||
// TODO: handle seemless migration. Temp, setting migrate to FALSE
|
||||
worker->display_channel = display_channel_new(worker, FALSE, streaming_video,
|
||||
worker->display_channel = display_channel_new(worker, FALSE, reds_get_streaming_video(reds),
|
||||
init_info.n_surfaces);
|
||||
|
||||
return worker;
|
||||
|
||||
@ -215,6 +215,7 @@ struct RedsState {
|
||||
uint8_t spice_uuid[16];
|
||||
|
||||
gboolean ticketing_enabled;
|
||||
uint32_t streaming_video;
|
||||
SpiceImageCompression image_compression;
|
||||
spice_wan_compression_t jpeg_state;
|
||||
spice_wan_compression_t zlib_glz_state;
|
||||
|
||||
@ -146,7 +146,6 @@ static SpiceCoreInterfaceInternal core_interface_adapter = {
|
||||
|
||||
static pthread_mutex_t *lock_cs;
|
||||
static long *lock_count;
|
||||
uint32_t streaming_video = SPICE_STREAM_VIDEO_FILTER;
|
||||
int agent_mouse = TRUE;
|
||||
|
||||
RedsState *reds = NULL;
|
||||
@ -3423,6 +3422,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->ticketing_enabled = TRUE; /* ticketing enabled by default */
|
||||
reds->streaming_video = SPICE_STREAM_VIDEO_FILTER;
|
||||
reds->image_compression = SPICE_IMAGE_COMPRESSION_AUTO_GLZ;
|
||||
reds->jpeg_state = SPICE_WAN_COMPRESSION_AUTO;
|
||||
reds->zlib_glz_state = SPICE_WAN_COMPRESSION_AUTO;
|
||||
@ -3787,11 +3787,16 @@ SPICE_GNUC_VISIBLE int spice_server_set_streaming_video(SpiceServer *s, int valu
|
||||
value != SPICE_STREAM_VIDEO_ALL &&
|
||||
value != SPICE_STREAM_VIDEO_FILTER)
|
||||
return -1;
|
||||
streaming_video = value;
|
||||
s->streaming_video = value;
|
||||
red_dispatcher_on_sv_change();
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t reds_get_streaming_video(const RedsState *reds)
|
||||
{
|
||||
return reds->streaming_video;
|
||||
}
|
||||
|
||||
SPICE_GNUC_VISIBLE int spice_server_set_playback_compression(SpiceServer *s, int enable)
|
||||
{
|
||||
spice_assert(reds == s);
|
||||
|
||||
@ -74,7 +74,6 @@ extern uint32_t renderers[RED_RENDERER_LAST];
|
||||
extern uint32_t num_renderers;
|
||||
|
||||
extern struct SpiceCoreInterfaceInternal *core;
|
||||
extern uint32_t streaming_video;
|
||||
|
||||
// Temporary measures to make splitting reds.c to inputs-channel.c easier
|
||||
|
||||
@ -111,6 +110,7 @@ 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);
|
||||
uint32_t reds_get_streaming_video(const RedsState *reds);
|
||||
spice_wan_compression_t reds_get_jpeg_state(const RedsState *reds);
|
||||
spice_wan_compression_t reds_get_zlib_glz_state(const RedsState *reds);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user