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

For #307, allow dedicated cache for GSO.

This commit is contained in:
winlin 2020-04-14 09:20:21 +08:00
parent 89a247d9bc
commit 8a71ce62db
9 changed files with 303 additions and 48 deletions

View file

@ -3614,7 +3614,8 @@ srs_error_t SrsConfig::check_normal_config()
for (int i = 0; conf && i < (int)conf->directives.size(); i++) {
string n = conf->at(i)->name;
if (n != "enabled" && n != "listen" && n != "dir" && n != "candidate" && n != "ecdsa"
&& n != "sendmmsg" && n != "encrypt" && n != "reuseport" && n != "gso" && n != "merge_nalus") {
&& n != "sendmmsg" && n != "encrypt" && n != "reuseport" && n != "gso" && n != "merge_nalus"
&& n != "gso_dedicated") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal rtc_server.%s", n.c_str());
}
}
@ -4814,6 +4815,31 @@ bool SrsConfig::get_rtc_server_gso()
return v;
}
bool SrsConfig::get_rtc_server_gso_dedicated()
{
static int DEFAULT = false;
SrsConfDirective* conf = root->get("rtc_server");
if (!conf) {
return DEFAULT;
}
conf = conf->get("gso_dedicated");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
bool v = SRS_CONF_PERFER_FALSE(conf->arg0());
#ifdef SRS_AUTO_OSX
if (v != DEFAULT) {
srs_warn("GSO is for Linux only");
}
#endif
return v;
}
SrsConfDirective* SrsConfig::get_rtc(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);