From d86af88573aa4456a68a8c22686504353c3032d2 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sat, 9 Jul 2022 16:28:09 +0000 Subject: [PATCH] server: Log encoder choices --- src/server.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/server.c b/src/server.c index 8b4ffc7..9d67876 100644 --- a/src/server.c +++ b/src/server.c @@ -582,6 +582,20 @@ static void send_pts_rect(struct nvnc_client* client, uint64_t pts) stream_write(client->net_stream, buf, sizeof(buf), NULL, NULL); } +static const char* encoding_to_string(enum rfb_encodings encoding) +{ + switch (encoding) { + case RFB_ENCODING_RAW: return "raw"; + case RFB_ENCODING_TIGHT: return "tight"; + case RFB_ENCODING_ZRLE: return "zrle"; + case RFB_ENCODING_OPEN_H264: return "open-h264"; + default: + break; + } + + return "UNKNOWN"; +} + static void process_fb_update_requests(struct nvnc_client* client) { struct nvnc* server = client->server; @@ -658,6 +672,9 @@ static void process_fb_update_requests(struct nvnc_client* client) server->n_damage_clients += !(client->encoder->impl->flags & ENCODER_IMPL_FLAG_IGNORES_DAMAGE); + + nvnc_log(NVNC_LOG_INFO, "Choosing %s encoding for client %p", + encoding_to_string(encoding), client); } enum encoder_kind kind = encoder_get_kind(client->encoder);