mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Merge code.
Conflicts: trunk/configure trunk/src/app/srs_app_source.cpp trunk/src/kernel/srs_kernel_error.hpp
This commit is contained in:
commit
e57bda8908
90 changed files with 4584 additions and 3576 deletions
|
@ -1419,7 +1419,6 @@ int SrsConfig::check_config()
|
|||
string m = conf->at(j)->name.c_str();
|
||||
if (m != "enabled" && m != "dvr_path" && m != "dvr_plan"
|
||||
&& m != "dvr_duration" && m != "dvr_wait_keyframe" && m != "time_jitter"
|
||||
&& m != "dvr_autostart"
|
||||
) {
|
||||
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
||||
srs_error("unsupported vhost dvr directive %s, ret=%d", m.c_str(), ret);
|
||||
|
@ -1978,38 +1977,6 @@ int SrsConfig::get_stream_caster_rtp_port_max(SrsConfDirective* sc)
|
|||
return ::atoi(conf->arg0().c_str());
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::create_directive(string vhost, string directive, string sub_directive)
|
||||
{
|
||||
SrsConfDirective* vhost_conf = get_vhost(vhost);
|
||||
|
||||
if (!vhost_conf) {
|
||||
vhost_conf = new SrsConfDirective();
|
||||
root->directives.push_back(vhost_conf);
|
||||
}
|
||||
|
||||
if (directive.empty()) {
|
||||
return vhost_conf;
|
||||
}
|
||||
|
||||
SrsConfDirective* dir = vhost_conf->get(directive);
|
||||
if (!dir) {
|
||||
dir = new SrsConfDirective();
|
||||
vhost_conf->directives.push_back(dir);
|
||||
}
|
||||
|
||||
if (sub_directive.empty()) {
|
||||
return dir;
|
||||
}
|
||||
|
||||
SrsConfDirective* sdir = dir->get(sub_directive);
|
||||
if (!sdir) {
|
||||
sdir = new SrsConfDirective();
|
||||
dir->directives.push_back(sdir);
|
||||
}
|
||||
|
||||
return sdir;
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_vhost(string vhost)
|
||||
{
|
||||
srs_assert(root);
|
||||
|
@ -3422,13 +3389,6 @@ bool SrsConfig::get_dvr_enabled(string vhost)
|
|||
return false;
|
||||
}
|
||||
|
||||
void SrsConfig::set_dvr_enabled(string vhost, bool enabled)
|
||||
{
|
||||
SrsConfDirective* conf = create_directive(vhost, "dvr", "enabled");
|
||||
conf->args.clear();
|
||||
conf->args.push_back(enabled? "on":"off");
|
||||
}
|
||||
|
||||
string SrsConfig::get_dvr_path(string vhost)
|
||||
{
|
||||
SrsConfDirective* dvr = get_dvr(vhost);
|
||||
|
@ -3446,13 +3406,6 @@ string SrsConfig::get_dvr_path(string vhost)
|
|||
return conf->arg0();
|
||||
}
|
||||
|
||||
void SrsConfig::set_dvr_path(string vhost, string path)
|
||||
{
|
||||
SrsConfDirective* conf = create_directive(vhost, "dvr", "dvr_path");
|
||||
conf->args.clear();
|
||||
conf->args.push_back(path);
|
||||
}
|
||||
|
||||
string SrsConfig::get_dvr_plan(string vhost)
|
||||
{
|
||||
SrsConfDirective* dvr = get_dvr(vhost);
|
||||
|
@ -3504,30 +3457,6 @@ bool SrsConfig::get_dvr_wait_keyframe(string vhost)
|
|||
return false;
|
||||
}
|
||||
|
||||
void SrsConfig::set_dvr_wait_keyframe(string vhost, bool wait_keyframe)
|
||||
{
|
||||
SrsConfDirective* conf = create_directive(vhost, "dvr", "dvr_wait_keyframe");
|
||||
conf->args.clear();
|
||||
conf->args.push_back(wait_keyframe? "on":"off");
|
||||
}
|
||||
|
||||
bool SrsConfig::get_dvr_autostart(string vhost)
|
||||
{
|
||||
SrsConfDirective* dvr = get_dvr(vhost);
|
||||
|
||||
if (!dvr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
SrsConfDirective* conf = dvr->get("dvr_autostart");
|
||||
|
||||
if (!conf || conf->arg0() != "off") {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int SrsConfig::get_dvr_time_jitter(string vhost)
|
||||
{
|
||||
SrsConfDirective* dvr = get_dvr(vhost);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue