From 5fb59a7c389d0340dd1465b69bb4157de491af7a Mon Sep 17 00:00:00 2001
From: Koichiro Iwao
Date: Sat, 16 Nov 2024 00:00:00 +0900
Subject: [PATCH 1/3] Set different frame capture interval for H.264 and RFX
and pass them to xorgxrdp.
(cherry picked from commit c55694c51b570d84ad63bfb5dc7bdec75fee57da)
---
common/xrdp_client_info.h | 7 ++++++-
common/xrdp_constants.h | 5 +++++
xrdp/xrdp.ini.in | 4 ++++
xup/xup.c | 25 +++++++++++++++++++++++++
4 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/common/xrdp_client_info.h b/common/xrdp_client_info.h
index 45965beade..ce9c92185c 100644
--- a/common/xrdp_client_info.h
+++ b/common/xrdp_client_info.h
@@ -255,6 +255,11 @@ struct xrdp_client_info
enum unicode_input_state unicode_input_support;
enum xrdp_capture_code capture_code;
+
+ /* xorgxrdp: frame capture interval (milliseconds) */
+ int rfx_frame_interval;
+ int h264_frame_interval;
+ int normal_frame_interval;
};
enum xrdp_encoder_flags
@@ -274,6 +279,6 @@ enum xrdp_encoder_flags
/* yyyymmdd of last incompatible change to xrdp_client_info */
/* also used for changes to all the xrdp installed headers */
-#define CLIENT_INFO_CURRENT_VERSION 20240805
+#define CLIENT_INFO_CURRENT_VERSION 20241118
#endif
diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h
index 200990e0b2..c20d970ace 100644
--- a/common/xrdp_constants.h
+++ b/common/xrdp_constants.h
@@ -83,6 +83,11 @@
#define MCS_SDRQ 25 /* Send Data Request */
#define MCS_SDIN 26 /* Send Data Indication */
+/* xorgxrdp: frame capture interval (milliseconds) */
+#define RFX_FRAME_INTERVAL 32
+#define H264_FRAME_INTERVAL 16
+#define NORMAL_FRAME_INTERVAL 40
+
/******************************************************************************
*
* Constants come from other Microsoft products
diff --git a/xrdp/xrdp.ini.in b/xrdp/xrdp.ini.in
index e855e7df4a..5bd79c78e8 100644
--- a/xrdp/xrdp.ini.in
+++ b/xrdp/xrdp.ini.in
@@ -249,6 +249,10 @@ password=ask
port=-1
code=20
#keycode_set=evdev
+; Frame capture interval (milliseconds)
+h264_frame_interval=16
+rfx_frame_interval=32
+normal_frame_interval=40
[Xvnc]
name=Xvnc
diff --git a/xup/xup.c b/xup/xup.c
index 71ced6001c..6fb0159a96 100644
--- a/xup/xup.c
+++ b/xup/xup.c
@@ -191,6 +191,19 @@ lib_mod_connect(struct mod *mod)
LOG(LOG_LEVEL_INFO, "XKB rules '%s' will be used by the module",
mod->client_info.xkb_rules);
+ if (mod->client_info.h264_frame_interval <= 0)
+ {
+ mod->client_info.h264_frame_interval = H264_FRAME_INTERVAL;
+ }
+ if (mod->client_info.rfx_frame_interval <= 0)
+ {
+ mod->client_info.rfx_frame_interval = RFX_FRAME_INTERVAL;
+ }
+ if (mod->client_info.normal_frame_interval <= 0)
+ {
+ mod->client_info.normal_frame_interval = NORMAL_FRAME_INTERVAL;
+ }
+
make_stream(s);
g_sprintf(con_port, "%s", mod->port);
@@ -1887,6 +1900,18 @@ lib_mod_set_param(struct mod *mod, const char *name, const char *value)
{
g_snprintf(mod->keycode_set, sizeof(mod->keycode_set), "%s", value);
}
+ else if (g_strcasecmp(name, "h264_frame_interval") == 0)
+ {
+ mod->client_info.h264_frame_interval = g_atoi(value);
+ }
+ else if (g_strcasecmp(name, "rfx_frame_interval") == 0)
+ {
+ mod->client_info.rfx_frame_interval = g_atoi(value);
+ }
+ else if (g_strcasecmp(name, "normal_frame_interval") == 0)
+ {
+ mod->client_info.normal_frame_interval = g_atoi(value);
+ }
else if (g_strcasecmp(name, "client_info") == 0)
{
g_memcpy(&(mod->client_info), value, sizeof(mod->client_info));
From 7214afb1322aed648afa36222bc37689cb7c4ccd Mon Sep 17 00:00:00 2001
From: Koichiro Iwao
Date: Tue, 19 Nov 2024 21:06:53 +0900
Subject: [PATCH 2/3] Add DEFAULT_ prefix for default frame capture intervals
(cherry picked from commit 65f9ae4afbd5c8c4c608a9014177542d7d4f51a6)
---
common/xrdp_constants.h | 6 +++---
xup/xup.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/common/xrdp_constants.h b/common/xrdp_constants.h
index c20d970ace..0b6d4a2627 100644
--- a/common/xrdp_constants.h
+++ b/common/xrdp_constants.h
@@ -84,9 +84,9 @@
#define MCS_SDIN 26 /* Send Data Indication */
/* xorgxrdp: frame capture interval (milliseconds) */
-#define RFX_FRAME_INTERVAL 32
-#define H264_FRAME_INTERVAL 16
-#define NORMAL_FRAME_INTERVAL 40
+#define DEFAULT_RFX_FRAME_INTERVAL 32
+#define DEFAULT_H264_FRAME_INTERVAL 16
+#define DEFAULT_NORMAL_FRAME_INTERVAL 40
/******************************************************************************
*
diff --git a/xup/xup.c b/xup/xup.c
index 6fb0159a96..840c0df16f 100644
--- a/xup/xup.c
+++ b/xup/xup.c
@@ -193,15 +193,15 @@ lib_mod_connect(struct mod *mod)
if (mod->client_info.h264_frame_interval <= 0)
{
- mod->client_info.h264_frame_interval = H264_FRAME_INTERVAL;
+ mod->client_info.h264_frame_interval = DEFAULT_H264_FRAME_INTERVAL;
}
if (mod->client_info.rfx_frame_interval <= 0)
{
- mod->client_info.rfx_frame_interval = RFX_FRAME_INTERVAL;
+ mod->client_info.rfx_frame_interval = DEFAULT_RFX_FRAME_INTERVAL;
}
if (mod->client_info.normal_frame_interval <= 0)
{
- mod->client_info.normal_frame_interval = NORMAL_FRAME_INTERVAL;
+ mod->client_info.normal_frame_interval = DEFAULT_NORMAL_FRAME_INTERVAL;
}
make_stream(s);
From 1964dab4dc7c17c56759434ba1b9f40d3df1fc71 Mon Sep 17 00:00:00 2001
From: Koichiro Iwao
Date: Tue, 19 Nov 2024 21:07:41 +0900
Subject: [PATCH 3/3] Frame capture intervals are not private to xrdp
(cherry picked from commit 56b4ca051e31650c836cab76eaf3e195117269bb)
---
common/xrdp_client_info.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/common/xrdp_client_info.h b/common/xrdp_client_info.h
index ce9c92185c..f99ef17405 100644
--- a/common/xrdp_client_info.h
+++ b/common/xrdp_client_info.h
@@ -206,6 +206,11 @@ struct xrdp_client_info
int x11_keycode_num_lock;
int x11_keycode_scroll_lock;
+ /* xorgxrdp: frame capture interval (milliseconds) */
+ int rfx_frame_interval;
+ int h264_frame_interval;
+ int normal_frame_interval;
+
/* ==================================================================== */
/* Private to xrdp below this line */
/* ==================================================================== */
@@ -255,11 +260,6 @@ struct xrdp_client_info
enum unicode_input_state unicode_input_support;
enum xrdp_capture_code capture_code;
-
- /* xorgxrdp: frame capture interval (milliseconds) */
- int rfx_frame_interval;
- int h264_frame_interval;
- int normal_frame_interval;
};
enum xrdp_encoder_flags