if (!oh264_ct)
{
TCLOG(LOG_LEVEL_WARNING, "OpenH264 params for connection type [%s] is not defined",
rdpbcgr_connection_type_names[connection_type]); return1;
}
/* EnableFrameSkip */
datum = toml_bool_in(oh264_ct, "EnableFrameSkip"); if (datum.ok)
{
param[connection_type].EnableFrameSkip = datum.u.b;
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[OpenH264.%s] EnableFrameSkip is not set, adopting the default value [0]",
rdpbcgr_connection_type_names[connection_type]);
param[connection_type].EnableFrameSkip = 0;
}
/* TargetBitrate */
datum = toml_int_in(oh264_ct, "TargetBitrate"); if (datum.ok)
{
param[connection_type].TargetBitrate = datum.u.i;
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[OpenH264.%s] TargetBitrate is not set, adopting the default value [0]",
rdpbcgr_connection_type_names[connection_type]);
param[connection_type].TargetBitrate = 0;
}
/* MaxBitrate */
datum = toml_int_in(oh264_ct, "MaxBitrate"); if (datum.ok)
{
param[connection_type].MaxBitrate = datum.u.i;
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[OpenH264.%s] MaxBitrate is not set, adopting the default value [0]",
rdpbcgr_connection_type_names[connection_type]);
param[connection_type].MaxBitrate = 0;
}
/* MaxFrameRate */
datum = toml_double_in(oh264_ct, "MaxFrameRate"); if (datum.ok)
{
param[connection_type].MaxFrameRate = (float)datum.u.d;
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[OpenH264.%s] MaxFrameRate is not set, adopting the default value [0]",
rdpbcgr_connection_type_names[connection_type]);
param[connection_type].MaxFrameRate = 0;
}
if (!x264_ct)
{
TCLOG(LOG_LEVEL_WARNING, "x264 params for connection type [%s] is not defined",
rdpbcgr_connection_type_names[connection_type]); return1;
}
/* preset */
datum = toml_string_in(x264_ct, "preset"); if (datum.ok)
{
g_strncpy(param[connection_type].preset,
datum.u.s, sizeof(param[connection_type].preset) - 1);
free(datum.u.s);
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[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, sizeof(param[connection_type].preset) - 1);
}
/* tune */
datum = toml_string_in(x264_ct, "tune"); if (datum.ok)
{
g_strncpy(param[connection_type].tune,
datum.u.s, sizeof(param[connection_type].tune) - 1);
free(datum.u.s);
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[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, sizeof(param[connection_type].tune) - 1);
}
/* profile */
datum = toml_string_in(x264_ct, "profile"); if (datum.ok)
{
g_strncpy(param[connection_type].profile,
datum.u.s, sizeof(param[connection_type].profile) - 1);
free(datum.u.s);
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[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, sizeof(param[connection_type].profile) - 1);
}
/* vbv_max_bitrate */
datum = toml_int_in(x264_ct, "vbv_max_bitrate"); if (datum.ok)
{
param[connection_type].vbv_max_bitrate = datum.u.i;
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[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;
}
/* vbv_buffer_size */
datum = toml_int_in(x264_ct, "vbv_buffer_size"); if (datum.ok)
{
param[connection_type].vbv_buffer_size = datum.u.i;
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[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;
}
/* fps_num */
datum = toml_int_in(x264_ct, "fps_num"); if (datum.ok)
{
param[connection_type].fps_num = datum.u.i;
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[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;
}
/* fps_den */
datum = toml_int_in(x264_ct, "fps_den"); if (datum.ok)
{
param[connection_type].fps_den = datum.u.i;
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[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;
}
/* threads */
datum = toml_int_in(x264_ct, "threads"); if (datum.ok)
{ if (datum.u.i >= 0)
{
param[connection_type].threads = datum.u.i;
} else
{
TCLOG(LOG_LEVEL_WARNING, "[x264.%s] an invalid value (< 0) is specified for threads, " "adopting the default value [%d]",
rdpbcgr_connection_type_names[connection_type],
X264_DEFAULT_THREADS);
param[connection_type].threads = X264_DEFAULT_THREADS;
}
} elseif (connection_type == 0)
{
TCLOG(LOG_LEVEL_WARNING, "[x264.%s] threads is not set, adopting the default value [%d]",
rdpbcgr_connection_type_names[connection_type],
X264_DEFAULT_THREADS);
param[connection_type].threads = X264_DEFAULT_THREADS;
}
if (h264_found == 0 && rfx_found == 0)
{ /* prefer H264 if no priority found */
config->codec.codecs[0] = XTC_H264;
config->codec.codecs[1] = XTC_RFX;
config->codec.codec_count = 2;
TCLOG(LOG_LEVEL_WARNING, "[codec] could not get GFX codec order, " "using default order %s",
tconfig_codec_order_to_str(&config->codec, buff, sizeof(buff)));
int
tconfig_load_gfx(constchar *filename, struct xrdp_tconfig_gfx *config)
{
FILE *fp; char errbuf[200];
toml_table_t *tfile; int rv = 0;
/* Default to just RFX support. in case we can't load anything */
config->codec.codec_count = 1;
config->codec.codecs[0] = XTC_RFX;
memset(config->x264_param, 0, sizeof(config->x264_param));
/* H.264 configuration */ if (codec_enabled(&config->codec, XTC_H264))
{ /* First of all, read the default params */ int x264_loaded; int oh264_loaded;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.