winlin

refine config, group by sections.

... ... @@ -765,6 +765,91 @@ void SrsConfig::print_help(char** argv)
argv[0]);
}
bool SrsConfig::get_deamon()
{
srs_assert(root);
SrsConfDirective* conf = root->get("daemon");
if (conf && conf->arg0() == "off") {
return false;
}
return true;
}
int SrsConfig::get_max_connections()
{
srs_assert(root);
SrsConfDirective* conf = root->get("max_connections");
if (!conf || conf->arg0().empty()) {
return 2000;
}
return ::atoi(conf->arg0().c_str());
}
SrsConfDirective* SrsConfig::get_listen()
{
return root->get("listen");
}
string SrsConfig::get_pid_file()
{
SrsConfDirective* conf = root->get("pid");
if (!conf) {
return SRS_CONF_DEFAULT_PID_FILE;
}
return conf->arg0();
}
int SrsConfig::get_pithy_print_publish()
{
SrsConfDirective* pithy = root->get("pithy_print");
if (!pithy) {
return SRS_STAGE_PUBLISH_USER_INTERVAL_MS;
}
pithy = pithy->get("publish");
if (!pithy) {
return SRS_STAGE_PUBLISH_USER_INTERVAL_MS;
}
return ::atoi(pithy->arg0().c_str());
}
int SrsConfig::get_pithy_print_forwarder()
{
SrsConfDirective* pithy = root->get("pithy_print");
if (!pithy) {
return SRS_STAGE_FORWARDER_INTERVAL_MS;
}
pithy = pithy->get("forwarder");
if (!pithy) {
return SRS_STAGE_FORWARDER_INTERVAL_MS;
}
return ::atoi(pithy->arg0().c_str());
}
int SrsConfig::get_pithy_print_hls()
{
SrsConfDirective* pithy = root->get("pithy_print");
if (!pithy) {
return SRS_STAGE_HLS_INTERVAL_MS;
}
pithy = pithy->get("hls");
if (!pithy) {
return SRS_STAGE_HLS_INTERVAL_MS;
}
return ::atoi(pithy->arg0().c_str());
}
SrsConfDirective* SrsConfig::get_vhost(string vhost)
{
srs_assert(root);
... ... @@ -939,190 +1024,156 @@ bool SrsConfig::get_vhost_enabled(SrsConfDirective* vhost)
return true;
}
SrsConfDirective* SrsConfig::get_transcode(string vhost, string scope)
bool SrsConfig::get_gop_cache(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return NULL;
}
SrsConfDirective* transcode = conf->get("transcode");
if (!transcode) {
return NULL;
}
if (transcode->arg0() == scope) {
return transcode;
}
return NULL;
}
bool SrsConfig::get_transcode_enabled(SrsConfDirective* transcode)
{
if (!transcode) {
return false;
return true;
}
SrsConfDirective* conf = transcode->get("enabled");
if (!conf || conf->arg0() != "on") {
conf = conf->get("gop_cache");
if (conf && conf->arg0() == "off") {
return false;
}
return true;
}
string SrsConfig::get_transcode_ffmpeg(SrsConfDirective* transcode)
bool SrsConfig::get_atc(string vhost)
{
if (!transcode) {
return "";
}
SrsConfDirective* conf = get_vhost(vhost);
SrsConfDirective* conf = transcode->get("ffmpeg");
if (!conf) {
return "";
}
return conf->arg0();
}
void SrsConfig::get_transcode_engines(SrsConfDirective* transcode, std::vector<SrsConfDirective*>& engines)
{
if (!transcode) {
return;
return true;
}
for (int i = 0; i < (int)transcode->directives.size(); i++) {
SrsConfDirective* conf = transcode->directives[i];
if (conf->name == "engine") {
engines.push_back(conf);
}
conf = conf->get("atc");
if (conf && conf->arg0() == "on") {
return true;
}
return;
return false;
}
bool SrsConfig::get_engine_enabled(SrsConfDirective* engine)
double SrsConfig::get_queue_length(string vhost)
{
if (!engine) {
return false;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_QUEUE_LENGTH;
}
SrsConfDirective* conf = engine->get("enabled");
if (!conf || conf->arg0() != "on") {
return false;
conf = conf->get("queue_length");
if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_QUEUE_LENGTH;
}
return true;
return ::atoi(conf->arg0().c_str());
}
string SrsConfig::get_engine_vcodec(SrsConfDirective* engine)
SrsConfDirective* SrsConfig::get_forward(string vhost)
{
if (!engine) {
return "";
}
SrsConfDirective* conf = get_vhost(vhost);
SrsConfDirective* conf = engine->get("vcodec");
if (!conf) {
return "";
return NULL;
}
return conf->arg0();
return conf->get("forward");
}
int SrsConfig::get_engine_vbitrate(SrsConfDirective* engine)
SrsConfDirective* SrsConfig::get_refer(string vhost)
{
if (!engine) {
return 0;
}
SrsConfDirective* conf = get_vhost(vhost);
SrsConfDirective* conf = engine->get("vbitrate");
if (!conf) {
return 0;
return NULL;
}
return ::atoi(conf->arg0().c_str());
return conf->get("refer");
}
double SrsConfig::get_engine_vfps(SrsConfDirective* engine)
SrsConfDirective* SrsConfig::get_refer_play(string vhost)
{
if (!engine) {
return 0;
}
SrsConfDirective* conf = get_vhost(vhost);
SrsConfDirective* conf = engine->get("vfps");
if (!conf) {
return 0;
return NULL;
}
return ::atof(conf->arg0().c_str());
return conf->get("refer_play");
}
int SrsConfig::get_engine_vwidth(SrsConfDirective* engine)
SrsConfDirective* SrsConfig::get_refer_publish(string vhost)
{
if (!engine) {
return 0;
}
SrsConfDirective* conf = get_vhost(vhost);
SrsConfDirective* conf = engine->get("vwidth");
if (!conf) {
return 0;
return NULL;
}
return ::atoi(conf->arg0().c_str());
return conf->get("refer_publish");
}
int SrsConfig::get_engine_vheight(SrsConfDirective* engine)
int SrsConfig::get_chunk_size(const std::string &vhost)
{
if (!engine) {
return 0;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_CHUNK_SIZE;
}
SrsConfDirective* conf = engine->get("vheight");
conf = conf->get("chunk_size");
if (!conf) {
return 0;
// vhost does not specify the chunk size,
// use the global instead.
conf = root->get("chunk_size");
if (!conf) {
return SRS_CONF_DEFAULT_CHUNK_SIZE;
}
return ::atoi(conf->arg0().c_str());
}
return ::atoi(conf->arg0().c_str());
}
int SrsConfig::get_engine_vthreads(SrsConfDirective* engine)
bool SrsConfig::get_bw_check_enabled(const string &vhost)
{
if (!engine) {
return 0;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return false;
}
SrsConfDirective* conf = engine->get("vthreads");
conf = conf->get("bandcheck");
if (!conf) {
return 0;
return false;
}
return ::atoi(conf->arg0().c_str());
conf = conf->get("enabled");
if (!conf || conf->arg0() != "on") {
return false;
}
return true;
}
string SrsConfig::get_engine_vprofile(SrsConfDirective* engine)
string SrsConfig::get_bw_check_key(const string &vhost)
{
if (!engine) {
return "";
}
SrsConfDirective* conf = get_vhost(vhost);
SrsConfDirective* conf = engine->get("vprofile");
if (!conf) {
return "";
}
return conf->arg0();
}
string SrsConfig::get_engine_vpreset(SrsConfDirective* engine)
{
if (!engine) {
conf = conf->get("bandcheck");
if (!conf) {
return "";
}
SrsConfDirective* conf = engine->get("vpreset");
conf = conf->get("key");
if (!conf) {
return "";
}
... ... @@ -1130,57 +1181,134 @@ string SrsConfig::get_engine_vpreset(SrsConfDirective* engine)
return conf->arg0();
}
void SrsConfig::get_engine_vparams(SrsConfDirective* engine, std::vector<string>& vparams)
int SrsConfig::get_bw_check_interval_ms(const string &vhost)
{
if (!engine) {
return;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_INTERVAL;
}
SrsConfDirective* conf = engine->get("vparams");
conf = conf->get("bandcheck");
if (!conf) {
return;
return SRS_CONF_DEFAULT_BANDWIDTH_INTERVAL;
}
for (int i = 0; i < (int)conf->directives.size(); i++) {
SrsConfDirective* p = conf->directives[i];
if (!p) {
continue;
conf = conf->get("interval_ms");
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_INTERVAL;
}
vparams.push_back("-" + p->name);
vparams.push_back(p->arg0());
return ::atoi(conf->arg0().c_str()) * 1000;
}
int SrsConfig::get_bw_check_limit_kbps(const string &vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS;
}
conf = conf->get("bandcheck");
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS;
}
conf = conf->get("limit_kbps");
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS;
}
return ::atoi(conf->arg0().c_str());
}
void SrsConfig::get_engine_vfilter(SrsConfDirective* engine, std::vector<string>& vfilter)
SrsConfDirective* SrsConfig::get_transcode(string vhost, string scope)
{
if (!engine) {
return;
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return NULL;
}
SrsConfDirective* conf = engine->get("vfilter");
SrsConfDirective* transcode = conf->get("transcode");
if (!transcode) {
return NULL;
}
if (transcode->arg0() == scope) {
return transcode;
}
return NULL;
}
bool SrsConfig::get_transcode_enabled(SrsConfDirective* transcode)
{
if (!transcode) {
return false;
}
SrsConfDirective* conf = transcode->get("enabled");
if (!conf || conf->arg0() != "on") {
return false;
}
return true;
}
string SrsConfig::get_transcode_ffmpeg(SrsConfDirective* transcode)
{
if (!transcode) {
return "";
}
SrsConfDirective* conf = transcode->get("ffmpeg");
if (!conf) {
return "";
}
return conf->arg0();
}
void SrsConfig::get_transcode_engines(SrsConfDirective* transcode, std::vector<SrsConfDirective*>& engines)
{
if (!transcode) {
return;
}
for (int i = 0; i < (int)conf->directives.size(); i++) {
SrsConfDirective* p = conf->directives[i];
if (!p) {
continue;
for (int i = 0; i < (int)transcode->directives.size(); i++) {
SrsConfDirective* conf = transcode->directives[i];
if (conf->name == "engine") {
engines.push_back(conf);
}
}
vfilter.push_back("-" + p->name);
vfilter.push_back(p->arg0());
return;
}
bool SrsConfig::get_engine_enabled(SrsConfDirective* engine)
{
if (!engine) {
return false;
}
SrsConfDirective* conf = engine->get("enabled");
if (!conf || conf->arg0() != "on") {
return false;
}
return true;
}
string SrsConfig::get_engine_acodec(SrsConfDirective* engine)
string SrsConfig::get_engine_vcodec(SrsConfDirective* engine)
{
if (!engine) {
return "";
}
SrsConfDirective* conf = engine->get("acodec");
SrsConfDirective* conf = engine->get("vcodec");
if (!conf) {
return "";
}
... ... @@ -1188,13 +1316,13 @@ string SrsConfig::get_engine_acodec(SrsConfDirective* engine)
return conf->arg0();
}
int SrsConfig::get_engine_abitrate(SrsConfDirective* engine)
int SrsConfig::get_engine_vbitrate(SrsConfDirective* engine)
{
if (!engine) {
return 0;
}
SrsConfDirective* conf = engine->get("abitrate");
SrsConfDirective* conf = engine->get("vbitrate");
if (!conf) {
return 0;
}
... ... @@ -1202,27 +1330,27 @@ int SrsConfig::get_engine_abitrate(SrsConfDirective* engine)
return ::atoi(conf->arg0().c_str());
}
int SrsConfig::get_engine_asample_rate(SrsConfDirective* engine)
double SrsConfig::get_engine_vfps(SrsConfDirective* engine)
{
if (!engine) {
return 0;
}
SrsConfDirective* conf = engine->get("asample_rate");
SrsConfDirective* conf = engine->get("vfps");
if (!conf) {
return 0;
}
return ::atoi(conf->arg0().c_str());
return ::atof(conf->arg0().c_str());
}
int SrsConfig::get_engine_achannels(SrsConfDirective* engine)
int SrsConfig::get_engine_vwidth(SrsConfDirective* engine)
{
if (!engine) {
return 0;
}
SrsConfDirective* conf = engine->get("achannels");
SrsConfDirective* conf = engine->get("vwidth");
if (!conf) {
return 0;
}
... ... @@ -1230,35 +1358,41 @@ int SrsConfig::get_engine_achannels(SrsConfDirective* engine)
return ::atoi(conf->arg0().c_str());
}
void SrsConfig::get_engine_aparams(SrsConfDirective* engine, std::vector<string>& aparams)
int SrsConfig::get_engine_vheight(SrsConfDirective* engine)
{
if (!engine) {
return;
return 0;
}
SrsConfDirective* conf = engine->get("aparams");
SrsConfDirective* conf = engine->get("vheight");
if (!conf) {
return;
return 0;
}
for (int i = 0; i < (int)conf->directives.size(); i++) {
SrsConfDirective* p = conf->directives[i];
if (!p) {
continue;
return ::atoi(conf->arg0().c_str());
}
int SrsConfig::get_engine_vthreads(SrsConfDirective* engine)
{
if (!engine) {
return 0;
}
aparams.push_back("-" + p->name);
aparams.push_back(p->arg0());
SrsConfDirective* conf = engine->get("vthreads");
if (!conf) {
return 0;
}
return ::atoi(conf->arg0().c_str());
}
string SrsConfig::get_engine_output(SrsConfDirective* engine)
string SrsConfig::get_engine_vprofile(SrsConfDirective* engine)
{
if (!engine) {
return "";
}
SrsConfDirective* conf = engine->get("output");
SrsConfDirective* conf = engine->get("vprofile");
if (!conf) {
return "";
}
... ... @@ -1266,87 +1400,154 @@ string SrsConfig::get_engine_output(SrsConfDirective* engine)
return conf->arg0();
}
bool SrsConfig::get_deamon()
string SrsConfig::get_engine_vpreset(SrsConfDirective* engine)
{
srs_assert(root);
if (!engine) {
return "";
}
SrsConfDirective* conf = root->get("daemon");
if (conf && conf->arg0() == "off") {
return false;
SrsConfDirective* conf = engine->get("vpreset");
if (!conf) {
return "";
}
return true;
return conf->arg0();
}
int SrsConfig::get_max_connections()
void SrsConfig::get_engine_vparams(SrsConfDirective* engine, std::vector<string>& vparams)
{
srs_assert(root);
if (!engine) {
return;
}
SrsConfDirective* conf = root->get("max_connections");
if (!conf || conf->arg0().empty()) {
return 2000;
SrsConfDirective* conf = engine->get("vparams");
if (!conf) {
return;
}
return ::atoi(conf->arg0().c_str());
for (int i = 0; i < (int)conf->directives.size(); i++) {
SrsConfDirective* p = conf->directives[i];
if (!p) {
continue;
}
vparams.push_back("-" + p->name);
vparams.push_back(p->arg0());
}
}
bool SrsConfig::get_gop_cache(string vhost)
void SrsConfig::get_engine_vfilter(SrsConfDirective* engine, std::vector<string>& vfilter)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!engine) {
return;
}
SrsConfDirective* conf = engine->get("vfilter");
if (!conf) {
return true;
return;
}
conf = conf->get("gop_cache");
if (conf && conf->arg0() == "off") {
return false;
for (int i = 0; i < (int)conf->directives.size(); i++) {
SrsConfDirective* p = conf->directives[i];
if (!p) {
continue;
}
return true;
vfilter.push_back("-" + p->name);
vfilter.push_back(p->arg0());
}
}
bool SrsConfig::get_atc(string vhost)
string SrsConfig::get_engine_acodec(SrsConfDirective* engine)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!engine) {
return "";
}
SrsConfDirective* conf = engine->get("acodec");
if (!conf) {
return true;
return "";
}
conf = conf->get("atc");
if (conf && conf->arg0() == "on") {
return true;
return conf->arg0();
}
int SrsConfig::get_engine_abitrate(SrsConfDirective* engine)
{
if (!engine) {
return 0;
}
return false;
SrsConfDirective* conf = engine->get("abitrate");
if (!conf) {
return 0;
}
return ::atoi(conf->arg0().c_str());
}
double SrsConfig::get_queue_length(string vhost)
int SrsConfig::get_engine_asample_rate(SrsConfDirective* engine)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!engine) {
return 0;
}
SrsConfDirective* conf = engine->get("asample_rate");
if (!conf) {
return SRS_CONF_DEFAULT_QUEUE_LENGTH;
return 0;
}
conf = conf->get("queue_length");
if (!conf || conf->arg0().empty()) {
return SRS_CONF_DEFAULT_QUEUE_LENGTH;
return ::atoi(conf->arg0().c_str());
}
int SrsConfig::get_engine_achannels(SrsConfDirective* engine)
{
if (!engine) {
return 0;
}
SrsConfDirective* conf = engine->get("achannels");
if (!conf) {
return 0;
}
return ::atoi(conf->arg0().c_str());
}
SrsConfDirective* SrsConfig::get_forward(string vhost)
void SrsConfig::get_engine_aparams(SrsConfDirective* engine, std::vector<string>& aparams)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!engine) {
return;
}
SrsConfDirective* conf = engine->get("aparams");
if (!conf) {
return NULL;
return;
}
return conf->get("forward");
for (int i = 0; i < (int)conf->directives.size(); i++) {
SrsConfDirective* p = conf->directives[i];
if (!p) {
continue;
}
aparams.push_back("-" + p->name);
aparams.push_back(p->arg0());
}
}
string SrsConfig::get_engine_output(SrsConfDirective* engine)
{
if (!engine) {
return "";
}
SrsConfDirective* conf = engine->get("output");
if (!conf) {
return "";
}
return conf->arg0();
}
string SrsConfig::get_srs_log_file()
... ... @@ -1553,207 +1754,6 @@ int SrsConfig::get_http_stream_listen()
return 8080;
}
SrsConfDirective* SrsConfig::get_refer(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return NULL;
}
return conf->get("refer");
}
SrsConfDirective* SrsConfig::get_refer_play(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return NULL;
}
return conf->get("refer_play");
}
SrsConfDirective* SrsConfig::get_refer_publish(string vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return NULL;
}
return conf->get("refer_publish");
}
SrsConfDirective* SrsConfig::get_listen()
{
return root->get("listen");
}
string SrsConfig::get_pid_file()
{
SrsConfDirective* conf = root->get("pid");
if (!conf) {
return SRS_CONF_DEFAULT_PID_FILE;
}
return conf->arg0();
}
int SrsConfig::get_chunk_size(const std::string &vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_CHUNK_SIZE;
}
conf = conf->get("chunk_size");
if (!conf) {
// vhost does not specify the chunk size,
// use the global instead.
conf = root->get("chunk_size");
if (!conf) {
return SRS_CONF_DEFAULT_CHUNK_SIZE;
}
return ::atoi(conf->arg0().c_str());
}
return ::atoi(conf->arg0().c_str());
}
int SrsConfig::get_pithy_print_publish()
{
SrsConfDirective* pithy = root->get("pithy_print");
if (!pithy) {
return SRS_STAGE_PUBLISH_USER_INTERVAL_MS;
}
pithy = pithy->get("publish");
if (!pithy) {
return SRS_STAGE_PUBLISH_USER_INTERVAL_MS;
}
return ::atoi(pithy->arg0().c_str());
}
int SrsConfig::get_pithy_print_forwarder()
{
SrsConfDirective* pithy = root->get("pithy_print");
if (!pithy) {
return SRS_STAGE_FORWARDER_INTERVAL_MS;
}
pithy = pithy->get("forwarder");
if (!pithy) {
return SRS_STAGE_FORWARDER_INTERVAL_MS;
}
return ::atoi(pithy->arg0().c_str());
}
int SrsConfig::get_pithy_print_hls()
{
SrsConfDirective* pithy = root->get("pithy_print");
if (!pithy) {
return SRS_STAGE_HLS_INTERVAL_MS;
}
pithy = pithy->get("hls");
if (!pithy) {
return SRS_STAGE_HLS_INTERVAL_MS;
}
return ::atoi(pithy->arg0().c_str());
}
bool SrsConfig::get_bw_check_enabled(const string &vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return false;
}
conf = conf->get("bandcheck");
if (!conf) {
return false;
}
conf = conf->get("enabled");
if (!conf || conf->arg0() != "on") {
return false;
}
return true;
}
string SrsConfig::get_bw_check_key(const string &vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return "";
}
conf = conf->get("bandcheck");
if (!conf) {
return "";
}
conf = conf->get("key");
if (!conf) {
return "";
}
return conf->arg0();
}
int SrsConfig::get_bw_check_interval_ms(const string &vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_INTERVAL;
}
conf = conf->get("bandcheck");
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_INTERVAL;
}
conf = conf->get("interval_ms");
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_INTERVAL;
}
return ::atoi(conf->arg0().c_str()) * 1000;
}
int SrsConfig::get_bw_check_limit_kbps(const string &vhost)
{
SrsConfDirective* conf = get_vhost(vhost);
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS;
}
conf = conf->get("bandcheck");
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS;
}
conf = conf->get("limit_kbps");
if (!conf) {
return SRS_CONF_DEFAULT_BANDWIDTH_LIMIT_KBPS;
}
return ::atoi(conf->arg0().c_str());
}
int SrsConfig::get_pithy_print_encoder()
{
SrsConfDirective* pithy = root->get("encoder");
... ...
... ... @@ -116,6 +116,18 @@ private:
virtual int parse_file(const char* filename);
virtual int parse_argv(int& i, char** argv);
virtual void print_help(char** argv);
// global section
public:
virtual bool get_deamon();
virtual int get_max_connections();
virtual SrsConfDirective* get_listen();
virtual std::string get_pid_file();
virtual int get_pithy_print_publish();
virtual int get_pithy_print_forwarder();
virtual int get_pithy_print_encoder();
virtual int get_pithy_print_hls();
virtual int get_pithy_print_play();
// vhost section
public:
virtual SrsConfDirective* get_vhost(std::string vhost);
virtual bool get_vhost_enabled(std::string vhost);
... ... @@ -126,6 +138,22 @@ public:
virtual SrsConfDirective* get_vhost_on_unpublish(std::string vhost);
virtual SrsConfDirective* get_vhost_on_play(std::string vhost);
virtual SrsConfDirective* get_vhost_on_stop(std::string vhost);
virtual bool get_gop_cache(std::string vhost);
virtual bool get_atc(std::string vhost);
virtual double get_queue_length(std::string vhost);
virtual SrsConfDirective* get_forward(std::string vhost);
virtual SrsConfDirective* get_refer(std::string vhost);
virtual SrsConfDirective* get_refer_play(std::string vhost);
virtual SrsConfDirective* get_refer_publish(std::string vhost);
virtual int get_chunk_size(const std::string& vhost);
// bwct(bandwidth check tool) section
public:
virtual bool get_bw_check_enabled(const std::string& vhost);
virtual std::string get_bw_check_key(const std::string& vhost);
virtual int get_bw_check_interval_ms(const std::string& vhost);
virtual int get_bw_check_limit_kbps(const std::string& vhost);
// vhost transcode section
public:
virtual SrsConfDirective* get_transcode(std::string vhost, std::string scope);
virtual bool get_transcode_enabled(SrsConfDirective* transcode);
virtual std::string get_transcode_ffmpeg(SrsConfDirective* transcode);
... ... @@ -147,12 +175,6 @@ public:
virtual int get_engine_achannels(SrsConfDirective* engine);
virtual void get_engine_aparams(SrsConfDirective* engine, std::vector<std::string>& aparams);
virtual std::string get_engine_output(SrsConfDirective* engine);
virtual bool get_deamon();
virtual int get_max_connections();
virtual bool get_gop_cache(std::string vhost);
virtual bool get_atc(std::string vhost);
virtual double get_queue_length(std::string vhost);
virtual SrsConfDirective* get_forward(std::string vhost);
// log section
public:
virtual bool get_srs_log_tank_file();
... ... @@ -179,23 +201,6 @@ private:
public:
virtual bool get_http_stream_enabled();
virtual int get_http_stream_listen();
// others
public:
virtual SrsConfDirective* get_refer(std::string vhost);
virtual SrsConfDirective* get_refer_play(std::string vhost);
virtual SrsConfDirective* get_refer_publish(std::string vhost);
virtual SrsConfDirective* get_listen();
virtual std::string get_pid_file();
virtual int get_chunk_size(const std::string& vhost);
virtual int get_pithy_print_publish();
virtual int get_pithy_print_forwarder();
virtual int get_pithy_print_encoder();
virtual int get_pithy_print_hls();
virtual int get_pithy_print_play();
virtual bool get_bw_check_enabled(const std::string& vhost);
virtual std::string get_bw_check_key(const std::string& vhost);
virtual int get_bw_check_interval_ms(const std::string& vhost);
virtual int get_bw_check_limit_kbps(const std::string& vhost);
};
/**
... ...