From 16ef3dc3a8bb390b70d242f11f44e17c2d298c40 Mon Sep 17 00:00:00 2001 From: Koichiro Iwao Date: Sat, 24 Aug 2024 00:07:11 +0900 Subject: [PATCH 1/2] tconfig: set proper default value for fps_den --- xrdp/xrdp_tconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xrdp/xrdp_tconfig.c b/xrdp/xrdp_tconfig.c index d16a0f4a..82b9c895 100644 --- a/xrdp/xrdp_tconfig.c +++ b/xrdp/xrdp_tconfig.c @@ -193,7 +193,7 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, "x264 param fps_den is not set for connection type [%s], " "adopting the default value [0]", rdpbcgr_connection_type_names[connection_type]); - param[connection_type].fps_num = X264_DEFAULT_FPS_DEN; + param[connection_type].fps_den = X264_DEFAULT_FPS_DEN; } return 0; From b9d593bc11a47ab48d84f20e0fec5c6bb808f5f5 Mon Sep 17 00:00:00 2001 From: Koichiro Iwao Date: Sat, 24 Aug 2024 00:09:46 +0900 Subject: [PATCH 2/2] tconfig: refine logging --- xrdp/xrdp_tconfig.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/xrdp/xrdp_tconfig.c b/xrdp/xrdp_tconfig.c index 82b9c895..663f9bce 100644 --- a/xrdp/xrdp_tconfig.c +++ b/xrdp/xrdp_tconfig.c @@ -52,16 +52,18 @@ static int tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, struct xrdp_tconfig_gfx_x264_param *param) { + TCLOG(LOG_LEVEL_TRACE, "[x264]"); + if (connection_type > NUM_CONNECTION_TYPES) { - TCLOG(LOG_LEVEL_ERROR, "Invalid connection type is given"); + TCLOG(LOG_LEVEL_ERROR, "[x264] Invalid connection type is given"); return 1; } toml_table_t *x264 = toml_table_in(tfile, "x264"); if (!x264) { - TCLOG(LOG_LEVEL_WARNING, "x264 params are not defined"); + TCLOG(LOG_LEVEL_WARNING, "[x264] x264 params are not defined"); return 1; } @@ -88,8 +90,8 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, else if (connection_type == 0) { TCLOG(LOG_LEVEL_WARNING, - "x264 param preset is not set for connection type [%s], " - "adopting the default value \"" X264_DEFAULT_PRESET "\"", + "[x264.%s] preset is not set, adopting the default value \"" + X264_DEFAULT_PRESET "\"", rdpbcgr_connection_type_names[connection_type]); g_strncpy(param[connection_type].preset, X264_DEFAULT_PRESET, @@ -108,8 +110,8 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, else if (connection_type == 0) { TCLOG(LOG_LEVEL_WARNING, - "x264 param tune is not set for connection type [%s], " - "adopting the default value \"" X264_DEFAULT_TUNE "\"", + "[x264.%s] tune is not set, adopting the default value \"" + X264_DEFAULT_TUNE"\"", rdpbcgr_connection_type_names[connection_type]); g_strncpy(param[connection_type].tune, X264_DEFAULT_TUNE, @@ -128,8 +130,8 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, else if (connection_type == 0) { TCLOG(LOG_LEVEL_WARNING, - "x264 param profile is not set for connection type [%s], " - "adopting the default value \"" X264_DEFAULT_PROFILE "\"", + "[x264.%s] profile is not set, adopting the default value \"" + X264_DEFAULT_PROFILE"\"", rdpbcgr_connection_type_names[connection_type]); g_strncpy(param[connection_type].profile, X264_DEFAULT_PROFILE, @@ -145,8 +147,7 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, else if (connection_type == 0) { TCLOG(LOG_LEVEL_WARNING, - "x264 param vbv_max_bit_rate is not set for connection type [%s], " - "adopting the default value [0]", + "[x264.%s] vbv_max_bitrate is not set, adopting the default value [0]", rdpbcgr_connection_type_names[connection_type]); param[connection_type].vbv_max_bitrate = 0; } @@ -160,8 +161,7 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, else if (connection_type == 0) { TCLOG(LOG_LEVEL_WARNING, - "x264 param vbv_buffer_size is not set for connection type [%s], " - "adopting the default value [0]", + "[x264.%s] vbv_buffer_size is not set, adopting the default value [0]", rdpbcgr_connection_type_names[connection_type]); param[connection_type].vbv_buffer_size = 0; } @@ -175,9 +175,9 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, else if (connection_type == 0) { TCLOG(LOG_LEVEL_WARNING, - "x264 param fps_num is not set for connection type [%s], " - "adopting the default value [0]", - rdpbcgr_connection_type_names[connection_type]); + "[x264.%s] fps_num is not set, adopting the default value [%d]", + rdpbcgr_connection_type_names[connection_type], + X264_DEFAULT_FPS_NUM); param[connection_type].fps_num = X264_DEFAULT_FPS_NUM; } @@ -190,9 +190,9 @@ tconfig_load_gfx_x264_ct(toml_table_t *tfile, const int connection_type, else if (connection_type == 0) { TCLOG(LOG_LEVEL_WARNING, - "x264 param fps_den is not set for connection type [%s], " - "adopting the default value [0]", - rdpbcgr_connection_type_names[connection_type]); + "[x264.%s] fps_den is not set, adopting the default value [%d]", + rdpbcgr_connection_type_names[connection_type], + X264_DEFAULT_FPS_DEN); param[connection_type].fps_den = X264_DEFAULT_FPS_DEN; }