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

RTC: Cache the large buffer allocation

This commit is contained in:
winlin 2021-02-26 19:46:52 +08:00
parent 6e9cb059b3
commit 4d0863468a
9 changed files with 135 additions and 133 deletions

View file

@ -3651,7 +3651,7 @@ srs_error_t SrsConfig::check_normal_config()
string n = conf->at(i)->name;
if (n != "enabled" && n != "listen" && n != "dir" && n != "candidate" && n != "ecdsa"
&& n != "encrypt" && n != "reuseport" && n != "merge_nalus" && n != "perf_stat" && n != "black_hole"
&& n != "ip_family" && n != "rtp_cache") {
&& n != "ip_family" && n != "rtp_cache" && n != "rtp_msg_cache") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal rtc_server.%s", n.c_str());
}
}
@ -4919,6 +4919,23 @@ bool SrsConfig::get_rtc_server_rtp_cache()
return SRS_CONF_PERFER_FALSE(conf->arg0());
}
bool SrsConfig::get_rtc_server_rtp_msg_cache()
{
static bool DEFAULT = false;
SrsConfDirective* conf = root->get("rtc_server");
if (!conf) {
return DEFAULT;
}
conf = conf->get("rtp_msg_cache");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return SRS_CONF_PERFER_FALSE(conf->arg0());
}
bool SrsConfig::get_rtc_server_black_hole()
{
static bool DEFAULT = false;