mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
remove flashP2P hss dvr, for it's a can-not-run feature. 0.9.178
This commit is contained in:
parent
83d1e7288c
commit
79c641e8d6
11 changed files with 3 additions and 598 deletions
|
@ -1333,7 +1333,7 @@ int SrsConfig::check_config()
|
|||
for (int j = 0; j < (int)conf0->directives.size(); j++) {
|
||||
string m = conf0->at(j)->name.c_str();
|
||||
if (m != "enabled" && m != "on_connect" && m != "on_close" && m != "on_publish"
|
||||
&& m != "on_unpublish" && m != "on_play" && m != "on_stop" && m != "on_dvr_hss_reap_flv"
|
||||
&& m != "on_unpublish" && m != "on_play" && m != "on_stop"
|
||||
) {
|
||||
ret = ERROR_SYSTEM_CONFIG_INVALID;
|
||||
srs_error("unsupported vhost http_hooks directive %s, ret=%d", m.c_str(), ret);
|
||||
|
@ -2096,17 +2096,6 @@ SrsConfDirective* SrsConfig::get_vhost_on_stop(string vhost)
|
|||
return conf->get("on_stop");
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_vhost_on_dvr_hss_reap_flv(string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost_http_hooks(vhost);
|
||||
|
||||
if (!conf) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return conf->get("on_dvr_hss_reap_flv");
|
||||
}
|
||||
|
||||
bool SrsConfig::get_bw_check_enabled(string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
|
|
@ -51,8 +51,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#define SRS_CONF_DEFAULT_DVR_PATH "./objs/nginx/html"
|
||||
#define SRS_CONF_DEFAULT_DVR_PLAN_SESSION "session"
|
||||
#define SRS_CONF_DEFAULT_DVR_PLAN_SEGMENT "segment"
|
||||
// chnvideo hss
|
||||
#define SRS_CONF_DEFAULT_DVR_PLAN_HSS "hss"
|
||||
#define SRS_CONF_DEFAULT_DVR_PLAN SRS_CONF_DEFAULT_DVR_PLAN_SESSION
|
||||
#define SRS_CONF_DEFAULT_DVR_DURATION 30
|
||||
#define SRS_CONF_DEFAULT_TIME_JITTER "full"
|
||||
|
@ -566,11 +564,6 @@ public:
|
|||
* @return the on_stop callback directive, the args is the url to callback.
|
||||
*/
|
||||
virtual SrsConfDirective* get_vhost_on_stop(std::string vhost);
|
||||
/**
|
||||
* get the on_dvr_hss_reap_flv callbacks of vhost.
|
||||
* @return the on_dvr_hss_reap_flv callback directive, the args is the url to callback.
|
||||
*/
|
||||
virtual SrsConfDirective* get_vhost_on_dvr_hss_reap_flv(std::string vhost);
|
||||
// bwct(bandwidth check tool) section
|
||||
public:
|
||||
/**
|
||||
|
|
|
@ -318,12 +318,6 @@ int SrsDvrPlan::flv_close()
|
|||
return ret;
|
||||
}
|
||||
|
||||
#ifdef SRS_AUTO_HTTP_CALLBACK
|
||||
if ((ret = on_dvr_hss_reap_flv()) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -366,29 +360,6 @@ int SrsDvrPlan::write_flv_header()
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsDvrPlan::on_dvr_hss_reap_flv()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
#ifdef SRS_AUTO_HTTP_CALLBACK
|
||||
if (!_srs_config->get_vhost_http_hooks_enabled(_req->vhost)) {
|
||||
// HTTP: on_dvr_hss_reap_flv
|
||||
SrsConfDirective* on_dvr_hss_reap_flv = _srs_config->get_vhost_on_dvr_hss_reap_flv(_req->vhost);
|
||||
if (!on_dvr_hss_reap_flv) {
|
||||
srs_info("ignore the empty http callback: on_dvr_hss_reap_flv");
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)on_dvr_hss_reap_flv->args.size(); i++) {
|
||||
std::string url = on_dvr_hss_reap_flv->args.at(i);
|
||||
SrsHttpHooks::on_dvr_hss_reap_flv(url, _req, segment);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SrsDvrPlan* SrsDvrPlan::create_plan(string vhost)
|
||||
{
|
||||
std::string plan = _srs_config->get_dvr_plan(vhost);
|
||||
|
@ -396,8 +367,6 @@ SrsDvrPlan* SrsDvrPlan::create_plan(string vhost)
|
|||
return new SrsDvrSegmentPlan();
|
||||
} else if (plan == SRS_CONF_DEFAULT_DVR_PLAN_SESSION) {
|
||||
return new SrsDvrSessionPlan();
|
||||
} else if (plan == SRS_CONF_DEFAULT_DVR_PLAN_HSS) {
|
||||
return new SrsDvrHssPlan();
|
||||
} else {
|
||||
return new SrsDvrSessionPlan();
|
||||
}
|
||||
|
@ -502,208 +471,6 @@ int SrsDvrSegmentPlan::update_duration(SrsSharedPtrMessage* msg)
|
|||
return ret;
|
||||
}
|
||||
|
||||
SrsDvrHssPlan::SrsDvrHssPlan()
|
||||
{
|
||||
segment_duration = -1;
|
||||
expect_reap_time = 0;
|
||||
}
|
||||
|
||||
SrsDvrHssPlan::~SrsDvrHssPlan()
|
||||
{
|
||||
}
|
||||
|
||||
int SrsDvrHssPlan::initialize(SrsSource* source, SrsRequest* req)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
if ((ret = SrsDvrPlan::initialize(source, req)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// TODO: FIXME: support reload
|
||||
segment_duration = _srs_config->get_dvr_duration(req->vhost);
|
||||
// to ms
|
||||
segment_duration *= 1000;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsDvrHssPlan::on_publish()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
// if already opened, continue to dvr.
|
||||
// the segment plan maybe keep running longer than the encoder.
|
||||
// for example, segment running, encoder restart,
|
||||
// the segment plan will just continue going and donot open new segment.
|
||||
if (fs->is_open()) {
|
||||
dvr_enabled = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = SrsDvrPlan::on_publish()) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// expect reap flv time
|
||||
expect_reap_time = segment->stream_starttime + segment_duration;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void SrsDvrHssPlan::on_unpublish()
|
||||
{
|
||||
// support multiple publish.
|
||||
if (!dvr_enabled) {
|
||||
return;
|
||||
}
|
||||
dvr_enabled = false;
|
||||
}
|
||||
|
||||
int SrsDvrHssPlan::on_meta_data(SrsOnMetaDataPacket* metadata)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
SrsRequest* req = _req;
|
||||
|
||||
// new flv file
|
||||
std::stringstream path;
|
||||
path << _srs_config->get_dvr_path(req->vhost)
|
||||
<< "/" << req->app << "/"
|
||||
<< req->stream << ".header.flv";
|
||||
|
||||
SrsFileWriter fs;
|
||||
if ((ret = fs.open(path.str().c_str())) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
SrsFlvEncoder enc;
|
||||
if ((ret = enc.initialize(&fs)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((ret = enc.write_header()) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
int size = 0;
|
||||
char* payload = NULL;
|
||||
if ((ret = metadata->encode(size, payload)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
SrsAutoFree(char, payload);
|
||||
|
||||
if ((ret = enc.write_metadata(payload, size)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef SRS_AUTO_HTTP_CALLBACK
|
||||
if ((ret = on_dvr_hss_reap_flv_header(path.str())) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsDvrHssPlan::write_flv_header()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsDvrHssPlan::on_dvr_request_sh()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsDvrHssPlan::on_video_keyframe()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
segment->sequence_header_offset = fs->tellg();
|
||||
if ((ret = SrsDvrPlan::on_dvr_request_sh()) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int64_t SrsDvrHssPlan::filter_timestamp(int64_t timestamp)
|
||||
{
|
||||
//return timestamp;
|
||||
srs_assert(segment);
|
||||
srs_verbose("filter timestamp from %"PRId64" to %"PRId64, timestamp, segment->stream_starttime + timestamp);
|
||||
return segment->stream_starttime + timestamp;
|
||||
}
|
||||
|
||||
int SrsDvrHssPlan::on_dvr_hss_reap_flv_header(string path)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
#ifdef SRS_AUTO_HTTP_CALLBACK
|
||||
if (!_srs_config->get_vhost_http_hooks_enabled(_req->vhost)) {
|
||||
// HTTP: on_dvr_hss_reap_flv_header
|
||||
SrsConfDirective* on_dvr_hss_reap_flv = _srs_config->get_vhost_on_dvr_hss_reap_flv(_req->vhost);
|
||||
if (!on_dvr_hss_reap_flv) {
|
||||
srs_info("ignore the empty http callback: on_dvr_hss_reap_flv");
|
||||
return ret;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)on_dvr_hss_reap_flv->args.size(); i++) {
|
||||
std::string url = on_dvr_hss_reap_flv->args.at(i);
|
||||
SrsHttpHooks::on_dvr_hss_reap_flv_header(url, _req, path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsDvrHssPlan::update_duration(SrsSharedPtrMessage* msg)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
if ((ret = SrsDvrPlan::update_duration(msg)) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
srs_assert(segment);
|
||||
|
||||
// if not initialized, ignore reap.
|
||||
if (expect_reap_time <= 0
|
||||
|| segment->stream_starttime <= 0
|
||||
|| segment->stream_duration <= 0
|
||||
) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// reap if exceed atc expect time.
|
||||
if (segment->stream_starttime + segment->stream_duration > expect_reap_time) {
|
||||
srs_verbose("hss reap start=%"PRId64", duration=%"PRId64", expect=%"PRId64
|
||||
", segment(start=%"PRId64", duration=%"PRId64", file=%s",
|
||||
segment->stream_starttime, segment->stream_duration, expect_reap_time,
|
||||
segment->stream_starttime + segment->starttime,
|
||||
segment->duration, segment->path.c_str());
|
||||
|
||||
// update expect reap time
|
||||
expect_reap_time += segment_duration;
|
||||
|
||||
if ((ret = flv_close()) != ERROR_SUCCESS) {
|
||||
segment->reset();
|
||||
return ret;
|
||||
}
|
||||
on_unpublish();
|
||||
|
||||
if ((ret = open_new_segment()) != ERROR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
SrsDvr::SrsDvr(SrsSource* source)
|
||||
{
|
||||
_source = source;
|
||||
|
|
|
@ -137,11 +137,6 @@ protected:
|
|||
virtual int on_dvr_request_sh();
|
||||
virtual int on_video_keyframe();
|
||||
virtual int64_t filter_timestamp(int64_t timestamp);
|
||||
private:
|
||||
/**
|
||||
* when srs reap the flv(close the segment), notice the api.
|
||||
*/
|
||||
virtual int on_dvr_hss_reap_flv();
|
||||
public:
|
||||
static SrsDvrPlan* create_plan(std::string vhost);
|
||||
};
|
||||
|
@ -177,33 +172,6 @@ private:
|
|||
virtual int update_duration(SrsSharedPtrMessage* msg);
|
||||
};
|
||||
|
||||
/**
|
||||
* hss plan: use atc time to reap flv segment
|
||||
*/
|
||||
class SrsDvrHssPlan : public SrsDvrPlan
|
||||
{
|
||||
private:
|
||||
// in config, in ms
|
||||
int segment_duration;
|
||||
int64_t expect_reap_time;
|
||||
public:
|
||||
SrsDvrHssPlan();
|
||||
virtual ~SrsDvrHssPlan();
|
||||
public:
|
||||
virtual int initialize(SrsSource* source, SrsRequest* req);
|
||||
virtual int on_publish();
|
||||
virtual void on_unpublish();
|
||||
virtual int on_meta_data(SrsOnMetaDataPacket* metadata);
|
||||
protected:
|
||||
virtual int write_flv_header();
|
||||
virtual int on_dvr_request_sh();
|
||||
virtual int on_video_keyframe();
|
||||
virtual int64_t filter_timestamp(int64_t timestamp);
|
||||
private:
|
||||
virtual int on_dvr_hss_reap_flv_header(std::string path);
|
||||
virtual int update_duration(SrsSharedPtrMessage* msg);
|
||||
};
|
||||
|
||||
/**
|
||||
* dvr(digital video recorder) to record RTMP stream to flv file.
|
||||
* TODO: FIXME: add utest for it.
|
||||
|
|
|
@ -326,114 +326,4 @@ void SrsHttpHooks::on_stop(string url, int client_id, string ip, SrsRequest* req
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef SRS_AUTO_DVR
|
||||
|
||||
void SrsHttpHooks::on_dvr_hss_reap_flv_header(std::string url, SrsRequest* req, std::string header_file)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
srs_verbose("flv header reap, file=%s", header_file.c_str());
|
||||
|
||||
SrsHttpUri uri;
|
||||
if ((ret = uri.initialize(url)) != ERROR_SUCCESS) {
|
||||
srs_warn("http uri parse on_dvr_hss_reap_flv_header url failed, ignored. "
|
||||
"url=%s, ret=%d", url.c_str(), ret);
|
||||
return;
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
ss << __SRS_JOBJECT_START
|
||||
<< __SRS_JFIELD_STR("action", "on_dvr_hss_reap_flv_header") << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_STR("vhost", req->vhost) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_STR("app", req->app) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_STR("stream", req->stream) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_NAME("segment") << __SRS_JOBJECT_START
|
||||
<< __SRS_JFIELD_STR("cwd", _srs_config->cwd()) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_STR("path", header_file)
|
||||
<< __SRS_JOBJECT_END
|
||||
<< __SRS_JOBJECT_END;
|
||||
std::string data = ss.str();
|
||||
std::string res;
|
||||
|
||||
SrsHttpClient http;
|
||||
if ((ret = http.post(&uri, data, res)) != ERROR_SUCCESS) {
|
||||
srs_warn("http post on_dvr_hss_reap_flv_header uri failed, ignored. "
|
||||
"url=%s, request=%s, response=%s, ret=%d",
|
||||
url.c_str(), data.c_str(), res.c_str(), ret);
|
||||
return;
|
||||
}
|
||||
|
||||
if (res.empty() || res != SRS_HTTP_RESPONSE_OK) {
|
||||
ret = ERROR_HTTP_DATA_INVLIAD;
|
||||
srs_warn("http hook on_dvr_hss_reap_flv_header validate failed, ignored. "
|
||||
"res=%s, ret=%d", res.c_str(), ret);
|
||||
return;
|
||||
}
|
||||
|
||||
srs_info("http hook on_dvr_hss_reap_flv_header success. "
|
||||
"url=%s, request=%s, response=%s, ret=%d",
|
||||
url.c_str(), data.c_str(), res.c_str(), ret);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void SrsHttpHooks::on_dvr_hss_reap_flv(string url, SrsRequest* req, SrsFlvSegment* segment)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
srs_assert(segment);
|
||||
srs_verbose("flv segment %s, atc_start=%"PRId64", "
|
||||
"has_key=%d, starttime=%"PRId64", duration=%d",
|
||||
segment->path.c_str(), segment->stream_starttime,
|
||||
segment->has_keyframe, segment->starttime, (int)segment->duration);
|
||||
|
||||
SrsHttpUri uri;
|
||||
if ((ret = uri.initialize(url)) != ERROR_SUCCESS) {
|
||||
srs_warn("http uri parse on_dvr_hss_reap_flv url failed, ignored. "
|
||||
"url=%s, ret=%d", url.c_str(), ret);
|
||||
return;
|
||||
}
|
||||
|
||||
std::stringstream ss;
|
||||
ss << __SRS_JOBJECT_START
|
||||
<< __SRS_JFIELD_STR("action", "on_dvr_hss_reap_flv") << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_STR("vhost", req->vhost) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_STR("app", req->app) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_STR("stream", req->stream) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_NAME("segment") << __SRS_JOBJECT_START
|
||||
<< __SRS_JFIELD_STR("cwd", _srs_config->cwd()) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_STR("path", segment->path) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_ORG("duration", segment->duration) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_ORG("offset", segment->sequence_header_offset) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_ORG("has_keyframe", (segment->has_keyframe? "true":"false")) << __SRS_JFIELD_CONT
|
||||
<< __SRS_JFIELD_ORG("pts", segment->stream_starttime + segment->starttime)
|
||||
<< __SRS_JOBJECT_END
|
||||
<< __SRS_JOBJECT_END;
|
||||
std::string data = ss.str();
|
||||
std::string res;
|
||||
|
||||
SrsHttpClient http;
|
||||
if ((ret = http.post(&uri, data, res)) != ERROR_SUCCESS) {
|
||||
srs_warn("http post on_dvr_hss_reap_flv uri failed, ignored. "
|
||||
"url=%s, request=%s, response=%s, ret=%d",
|
||||
url.c_str(), data.c_str(), res.c_str(), ret);
|
||||
return;
|
||||
}
|
||||
|
||||
if (res.empty() || res != SRS_HTTP_RESPONSE_OK) {
|
||||
ret = ERROR_HTTP_DATA_INVLIAD;
|
||||
srs_warn("http hook on_dvr_hss_reap_flv validate failed, ignored. "
|
||||
"res=%s, ret=%d", res.c_str(), ret);
|
||||
return;
|
||||
}
|
||||
|
||||
srs_info("http hook on_dvr_hss_reap_flv success. "
|
||||
"url=%s, request=%s, response=%s, ret=%d",
|
||||
url.c_str(), data.c_str(), res.c_str(), ret);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -98,23 +98,6 @@ public:
|
|||
* ignore if empty.
|
||||
*/
|
||||
static void on_stop(std::string url, int client_id, std::string ip, SrsRequest* req);
|
||||
#ifdef SRS_AUTO_DVR
|
||||
public:
|
||||
/**
|
||||
* on_dvr_hss_reap_flv_header hook, when dvr write flv file header.
|
||||
* @param url the api server url, to process the event.
|
||||
* ignore if empty.
|
||||
* @param header_file the flv header file.
|
||||
*/
|
||||
static void on_dvr_hss_reap_flv_header(std::string url, SrsRequest* req, std::string header_file);
|
||||
/**
|
||||
* on_dvr_hss_reap_flv hook, when dvr close flv file.
|
||||
* @param url the api server url, to process the event.
|
||||
* ignore if empty.
|
||||
* @param segment the current flv segment.
|
||||
*/
|
||||
static void on_dvr_hss_reap_flv(std::string url, SrsRequest* req, SrsFlvSegment* segment);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
// current release version
|
||||
#define VERSION_MAJOR "0"
|
||||
#define VERSION_MINOR "9"
|
||||
#define VERSION_REVISION "177"
|
||||
#define VERSION_REVISION "178"
|
||||
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
|
||||
// server info.
|
||||
#define RTMP_SIG_SRS_KEY "SRS"
|
||||
|
|
|
@ -208,7 +208,6 @@ std::string __full_conf = ""
|
|||
" # start to record to file when encoder publish, \n"
|
||||
" # reap flv according by specified dvr_plan. \n"
|
||||
" # http callbacks: \n"
|
||||
" # @see http callback on_dvr_hss_reap_flv on http_hooks section. \n"
|
||||
" dvr { \n"
|
||||
" # whether enabled dvr features \n"
|
||||
" # default: off \n"
|
||||
|
@ -228,7 +227,6 @@ std::string __full_conf = ""
|
|||
" # the dvr plan. canbe: \n"
|
||||
" # session reap flv when session end(unpublish). \n"
|
||||
" # segment reap flv when flv duration exceed the specified dvr_duration. \n"
|
||||
" # hss reap flv required by bravo(chnvideo.com) p2p system. \n"
|
||||
" # default: session \n"
|
||||
" dvr_plan session; \n"
|
||||
" # the param for plan(segment), in seconds. \n"
|
||||
|
@ -433,38 +431,6 @@ std::string __full_conf = ""
|
|||
" # support multiple api hooks, format: \n"
|
||||
" # on_stop http://xxx/api0 http://xxx/api1 http://xxx/apiN \n"
|
||||
" on_stop http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions; \n"
|
||||
" # \n"
|
||||
" # for dvr(dvr_plan is hss). \n"
|
||||
" # when dvr got flv header, call the hook, \n"
|
||||
" # the request in the POST data string is a object encode by json: \n"
|
||||
" # { \n"
|
||||
" # \"action\": \"on_dvr_hss_reap_flv_header\", \n"
|
||||
" # \"vhost\": \"video.test.com\", \"app\": \"live\", \n"
|
||||
" # \"stream\": \"livestream\", \n"
|
||||
" # \"segment\": { \n"
|
||||
" # \"cwd\": \"/usr/local/srs\", \n"
|
||||
" # \"path\": \"./objs/nginx/html/live/livestream.header.flv\" \n"
|
||||
" # } \n"
|
||||
" # } \n"
|
||||
" # when dvr reap flv file, call the hook, \n"
|
||||
" # the request in the POST data string is a object encode by json: \n"
|
||||
" # { \n"
|
||||
" # \"action\": \"on_dvr_hss_reap_flv\", \n"
|
||||
" # \"vhost\": \"video.test.com\", \"app\": \"live\", \n"
|
||||
" # \"stream\": \"livestream\", \n"
|
||||
" # \"segment\": { \n"
|
||||
" # \"cwd\": \"/usr/local/srs\", \n"
|
||||
" # \"path\": \"./objs/nginx/html/live/livestream.1398315892865.flv\", \n"
|
||||
" # \"duration\": 1001, \"offset\":0, \n"
|
||||
" # \"has_keyframe\": true, \"pts\":1398315895958 \n"
|
||||
" # } \n"
|
||||
" # } \n"
|
||||
" # if valid, the hook must return HTTP code 200(Stauts OK) and response \n"
|
||||
" # an int value specifies the error code(0 corresponding to success): \n"
|
||||
" # 0 \n"
|
||||
" # support multiple api hooks, format: \n"
|
||||
" # on_stop http://xxx/api0 http://xxx/api1 http://xxx/apiN \n"
|
||||
" on_dvr_hss_reap_flv http://127.0.0.1:8085/api/v1/dvrs http://localhost:8085/api/v1/dvrs; \n"
|
||||
" } \n"
|
||||
"} \n"
|
||||
" \n"
|
||||
|
@ -1098,9 +1064,6 @@ VOID TEST(ConfigTest, CheckMacros)
|
|||
#ifndef SRS_CONF_DEFAULT_DVR_PLAN_SEGMENT
|
||||
EXPECT_TRUE(false);
|
||||
#endif
|
||||
#ifndef SRS_CONF_DEFAULT_DVR_PLAN_HSS
|
||||
EXPECT_TRUE(false);
|
||||
#endif
|
||||
#ifndef SRS_CONF_DEFAULT_DVR_PLAN
|
||||
EXPECT_TRUE(false);
|
||||
#endif
|
||||
|
@ -1917,7 +1880,6 @@ VOID TEST(ConfigMainTest, ParseFullConf)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -1997,7 +1959,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_same_edge)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2077,7 +2038,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_change_edge)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2151,7 +2111,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_dvr)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2225,7 +2184,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_ingest)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2320,7 +2278,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_http)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2397,7 +2354,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_hls_enabled)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2474,7 +2430,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_hls_disabled)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2582,12 +2537,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_http_hooks)
|
|||
EXPECT_STREQ("http://127.0.0.1:8085/api/v1/sessions", callback->arg0().c_str());
|
||||
EXPECT_STREQ("http://localhost:8085/api/v1/sessions", callback->arg1().c_str());
|
||||
}
|
||||
EXPECT_TRUE(NULL != conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
if (true) {
|
||||
SrsConfDirective* callback = conf.get_vhost_on_dvr_hss_reap_flv(vhost);
|
||||
EXPECT_STREQ("http://127.0.0.1:8085/api/v1/dvrs", callback->arg0().c_str());
|
||||
EXPECT_STREQ("http://localhost:8085/api/v1/dvrs", callback->arg1().c_str());
|
||||
}
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2665,7 +2614,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_min_delay)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2758,7 +2706,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_refer_anti_suck)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2841,7 +2788,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_forward_same_vhost)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2920,7 +2866,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_forward_change_vhost)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -2998,7 +2943,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_mirror)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3087,7 +3031,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_crop)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3176,7 +3119,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_logo)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3265,7 +3207,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_audio)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3348,7 +3289,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_vn)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3431,7 +3371,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_copy)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3510,7 +3449,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_all)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3727,7 +3665,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_ffempty)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3816,7 +3753,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_app)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3905,7 +3841,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_transcode_stream)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -3994,7 +3929,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_bandcheck)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_STREQ("35c9b402c12a7246868752e2878f7e0e", conf.get_bw_check_key(vhost).c_str());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -4072,7 +4006,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_chunksize)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -4150,7 +4083,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_jitter)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -4228,7 +4160,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_atc)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -4306,7 +4237,6 @@ VOID TEST(ConfigMainTest, ParseFullConf_removed)
|
|||
EXPECT_TRUE(NULL == conf.get_vhost_on_unpublish(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_play(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_stop(vhost));
|
||||
EXPECT_TRUE(NULL == conf.get_vhost_on_dvr_hss_reap_flv(vhost));
|
||||
EXPECT_FALSE(conf.get_bw_check_enabled(vhost));
|
||||
EXPECT_TRUE(conf.get_bw_check_key(vhost).empty());
|
||||
EXPECT_EQ(30000, conf.get_bw_check_interval_ms(vhost));
|
||||
|
@ -5018,16 +4948,6 @@ VOID TEST(ConfigMainTest, CheckConf_hooks)
|
|||
MockSrsConfig conf;
|
||||
EXPECT_TRUE(ERROR_SUCCESS != conf.parse(_MIN_OK_CONF"vhost v{http_hooks{on_stops http://127.0.0.1:8085/api/v1/sessions http://localhost:8085/api/v1/sessions;}}"));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockSrsConfig conf;
|
||||
EXPECT_TRUE(ERROR_SUCCESS == conf.parse(_MIN_OK_CONF"vhost v{http_hooks{on_dvr_hss_reap_flv http://127.0.0.1:8085/api/v1/dvrs http://localhost:8085/api/v1/dvrs;}}"));
|
||||
}
|
||||
|
||||
if (true) {
|
||||
MockSrsConfig conf;
|
||||
EXPECT_TRUE(ERROR_SUCCESS != conf.parse(_MIN_OK_CONF"vhost v{http_hooks{on_dvr_hss_reap_flvs http://127.0.0.1:8085/api/v1/dvrs http://localhost:8085/api/v1/dvrs;}}"));
|
||||
}
|
||||
}
|
||||
|
||||
VOID TEST(ConfigMainTest, CheckConf_gop_cache)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue