Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v0.10] Set different frame capture interval for H.264 and RFX and pass them to xorgxrdp #3317

Open
wants to merge 3 commits into
base: v0.10-h264
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion common/xrdp_client_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ struct xrdp_client_info
char variant[16];
char options[256];

/* xorgxrdp: frame capture interval (milliseconds) */
int rfx_frame_interval;
int h264_frame_interval;
int normal_frame_interval;

/* ==================================================================== */
/* Private to xrdp below this line */
/* ==================================================================== */
Expand Down Expand Up @@ -260,6 +265,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 20240514
#define CLIENT_INFO_CURRENT_VERSION 20241118

#endif
5 changes: 5 additions & 0 deletions common/xrdp_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
#define MCS_SDRQ 25 /* Send Data Request */
#define MCS_SDIN 26 /* Send Data Indication */

/* xorgxrdp: frame capture interval (milliseconds) */
#define DEFAULT_RFX_FRAME_INTERVAL 32
#define DEFAULT_H264_FRAME_INTERVAL 16
#define DEFAULT_NORMAL_FRAME_INTERVAL 40

metalefty marked this conversation as resolved.
Show resolved Hide resolved
/******************************************************************************
*
* Constants come from other Microsoft products
Expand Down
4 changes: 4 additions & 0 deletions xrdp/xrdp.ini.in
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ username=ask
password=ask
port=-1
code=20
; Frame capture interval (milliseconds)
h264_frame_interval=16
rfx_frame_interval=32
normal_frame_interval=40

[Xvnc]
name=Xvnc
Expand Down
28 changes: 28 additions & 0 deletions xup/xup.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,22 @@ lib_mod_connect(struct mod *mod)
return 1;
}


// This is a good place to finalise any parameters that need to
// be set.
if (mod->client_info.h264_frame_interval <= 0)
{
mod->client_info.h264_frame_interval = DEFAULT_H264_FRAME_INTERVAL;
}
if (mod->client_info.rfx_frame_interval <= 0)
{
mod->client_info.rfx_frame_interval = DEFAULT_RFX_FRAME_INTERVAL;
}
if (mod->client_info.normal_frame_interval <= 0)
{
mod->client_info.normal_frame_interval = DEFAULT_NORMAL_FRAME_INTERVAL;
}

make_stream(s);
g_sprintf(con_port, "%s", mod->port);

Expand Down Expand Up @@ -1855,6 +1871,18 @@ lib_mod_set_param(struct mod *mod, const char *name, const char *value)
{
g_strncpy(mod->port, value, 255);
}
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));
Expand Down