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

add http callback in config

This commit is contained in:
winlin 2013-12-07 20:38:14 +08:00
parent d3cee00b3b
commit 3600be9796
2 changed files with 20 additions and 0 deletions

View file

@ -475,6 +475,8 @@ int SrsConfig::reload()
srs_trace("reload pithy_print success."); srs_trace("reload pithy_print success.");
} }
// TODO: suppor reload hls/forward/ffmpeg/http
return ret; return ret;
} }
@ -557,6 +559,22 @@ SrsConfDirective* SrsConfig::get_vhost(std::string vhost)
return NULL; return NULL;
} }
std::string SrsConfig::get_vhost_on_connect(std::string vhost)
{
SrsConfDirective* vhost_conf = get_vhost(vhost);
if (!vhost_conf) {
return "";
}
SrsConfDirective* conf = vhost_conf->get("on_connect");
if (!conf) {
return "";
}
return conf->arg0();
}
bool SrsConfig::get_vhost_enabled(std::string vhost) bool SrsConfig::get_vhost_enabled(std::string vhost)
{ {
SrsConfDirective* vhost_conf = get_vhost(vhost); SrsConfDirective* vhost_conf = get_vhost(vhost);
@ -1128,6 +1146,7 @@ int SrsConfig::parse_file(const char* filename)
// TODO: check hls. // TODO: check hls.
// TODO: check ssl. // TODO: check ssl.
// TODO: check ffmpeg. // TODO: check ffmpeg.
// TODO: check http.
return ret; return ret;
} }

View file

@ -119,6 +119,7 @@ public:
public: public:
virtual SrsConfDirective* get_vhost(std::string vhost); virtual SrsConfDirective* get_vhost(std::string vhost);
virtual bool get_vhost_enabled(std::string vhost); virtual bool get_vhost_enabled(std::string vhost);
virtual std::string get_vhost_on_connect(std::string vhost);
virtual SrsConfDirective* get_transcode(std::string vhost, std::string scope); virtual SrsConfDirective* get_transcode(std::string vhost, std::string scope);
virtual bool get_transcode_enabled(SrsConfDirective* transcode); virtual bool get_transcode_enabled(SrsConfDirective* transcode);
virtual std::string get_transcode_ffmpeg(SrsConfDirective* transcode); virtual std::string get_transcode_ffmpeg(SrsConfDirective* transcode);