winlin

reorder the config functions. add comments for st to support 100k threads, use MALLOC_STACK macro.

... ... @@ -283,7 +283,7 @@ install-api: install
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs-api
@echo ""
@echo "api installed, to link and start api:"
@echo " sudo ln -sf /usr/local/srs/etc/init.d/srs-api /etc/init.d/srs-api"
@echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs-api /etc/init.d/srs-api"
@echo " /etc/init.d/srs-api start"
@echo " http://\$(shell bash auto/local_ip.sh):8085"
@echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/LinuxService"
... ... @@ -306,7 +306,7 @@ install:
@sed -i "s|^ROOT=.*|ROOT=\"\$(SRS_PREFIX)\"|g" \$(__REAL_INSTALL)/etc/init.d/srs
@echo ""
@echo "srs installed, to link and start srs:"
@echo " sudo ln -sf /usr/local/srs/etc/init.d/srs /etc/init.d/srs"
@echo " sudo ln -sf \$(SRS_PREFIX)/etc/init.d/srs /etc/init.d/srs"
@echo " /etc/init.d/srs start"
@echo "@see: https://github.com/winlinvip/simple-rtmp-server/wiki/LinuxService"
... ...
... ... @@ -2746,58 +2746,58 @@ string SrsConfig::get_ingest_input_url(SrsConfDirective* ingest)
return conf->arg0();
}
string SrsConfig::get_log_file()
bool SrsConfig::get_log_tank_file()
{
srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_file");
if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_LOG_FILE;
SrsConfDirective* conf = root->get("srs_log_tank");
if (conf && conf->arg0() == SRS_CONF_DEFAULT_LOG_TANK_CONSOLE) {
return false;
}
return conf->arg0();
}
bool SrsConfig::get_ffmpeg_log_enabled()
{
string log = get_ffmpeg_log_dir();
return log != SRS_CONSTS_NULL_FILE;
return true;
}
string SrsConfig::get_ffmpeg_log_dir()
string SrsConfig::get_log_level()
{
srs_assert(root);
SrsConfDirective* conf = root->get("ff_log_dir");
SrsConfDirective* conf = root->get("srs_log_level");
if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_FF_LOG_DIR;
return SRS_CONF_DEFAULT_LOG_LEVEL;
}
return conf->arg0();
}
string SrsConfig::get_log_level()
string SrsConfig::get_log_file()
{
srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_level");
SrsConfDirective* conf = root->get("srs_log_file");
if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_LOG_LEVEL;
return SRS_CONF_DEFAULT_LOG_FILE;
}
return conf->arg0();
}
bool SrsConfig::get_log_tank_file()
bool SrsConfig::get_ffmpeg_log_enabled()
{
string log = get_ffmpeg_log_dir();
return log != SRS_CONSTS_NULL_FILE;
}
string SrsConfig::get_ffmpeg_log_dir()
{
srs_assert(root);
SrsConfDirective* conf = root->get("srs_log_tank");
if (conf && conf->arg0() == SRS_CONF_DEFAULT_LOG_TANK_CONSOLE) {
return false;
SrsConfDirective* conf = root->get("ff_log_dir");
if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_FF_LOG_DIR;
}
return true;
return conf->arg0();
}
SrsConfDirective* SrsConfig::get_hls(string vhost)
... ...
... ... @@ -545,6 +545,8 @@ int SrsServer::initialize_st()
}
srs_verbose("st_set_eventsys use linux epoll success");
// @remark, st alloc segment use mmap, which only support 32757 threads,
// if need to support more, for instance, 100k threads, define the macro MALLOC_STACK.
if(st_init() != 0){
ret = ERROR_ST_INITIALIZE;
srs_error("st_init failed. ret=%d", ret);
... ...