From c22a0c037951d08365ebc27f9ddba3e7c46e0da4 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Sun, 25 Feb 2024 10:59:54 +0000 Subject: [PATCH] Add option to enable experimental features With this, I can release without modifying things specially on the release branch. --- meson.build | 7 +++++++ meson_options.txt | 1 + src/server.c | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/meson.build b/meson.build index 9df76679..35a38dbe 100644 --- a/meson.build +++ b/meson.build @@ -155,6 +155,13 @@ if enable_websocket config.set('ENABLE_WEBSOCKET', true) endif +if get_option('experimental') + if buildtype == 'release' + warning('Experimental features enabled in release build') + endif + config.set('ENABLE_EXPERIMENTAL', true) +endif + configure_file( output: 'config.h', configuration: config, diff --git a/meson_options.txt b/meson_options.txt index ce6f81c4..a676caad 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -7,3 +7,4 @@ option('nettle', type: 'feature', value: 'auto', description: 'Enable nettle low option('systemtap', type: 'boolean', value: false, description: 'Enable tracing using sdt') option('gbm', type: 'feature', value: 'auto', description: 'Enable GBM integration') option('h264', type: 'feature', value: 'auto', description: 'Enable open h264 encoding') +option('experimental', type: 'boolean', value: false, description: 'Enable experimental features') diff --git a/src/server.c b/src/server.c index d0e7e42a..129ae37f 100644 --- a/src/server.c +++ b/src/server.c @@ -1025,9 +1025,16 @@ static int on_client_set_encodings(struct nvnc_client* client) case RFB_ENCODING_DESKTOPSIZE: case RFB_ENCODING_EXTENDEDDESKTOPSIZE: case RFB_ENCODING_QEMU_EXT_KEY_EVENT: +#ifdef ENABLE_EXPERIMENTAL case RFB_ENCODING_PTS: case RFB_ENCODING_NTP: +#endif client->encodings[n++] = encoding; +#ifndef ENABLE_EXPERIMENTAL + case RFB_ENCODING_PTS: + case RFB_ENCODING_NTP: + ; +#endif } if (RFB_ENCODING_JPEG_LOWQ <= encoding &&