1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

rtc: support publish twcc using twcc config

This commit is contained in:
jinxue.cgh 2020-05-19 18:17:41 +08:00 committed by winlin
parent d5e91694d5
commit 9840ad8d55
3 changed files with 43 additions and 0 deletions

View file

@ -5128,6 +5128,23 @@ bool SrsConfig::get_rtc_nack_enabled(string vhost)
return SRS_CONF_PERFER_TRUE(conf->arg0());
}
bool SrsConfig::get_rtc_twcc_enabled(string vhost)
{
static bool DEFAULT = true;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return DEFAULT;
}
conf = conf->get("twcc");
if (!conf) {
return DEFAULT;
}
conf = conf->get("enabled");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return SRS_CONF_PERFER_TRUE(conf->arg0());
}
SrsConfDirective* SrsConfig::get_vhost(string vhost, bool try_default_vhost)
{
srs_assert(root);