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

add config utest, for default vhost

This commit is contained in:
winlin 2014-07-21 12:13:01 +08:00
parent f1b1dc0c64
commit 77236920b6
3 changed files with 101 additions and 0 deletions

View file

@ -2312,6 +2312,10 @@ SrsConfDirective* SrsConfig::get_ingest_by_id(string vhost, string ingest_id)
bool SrsConfig::get_ingest_enabled(SrsConfDirective* ingest)
{
if (!ingest) {
return false;
}
SrsConfDirective* conf = ingest->get("enabled");
if (!conf || conf->arg0() != "on") {
@ -2323,6 +2327,10 @@ bool SrsConfig::get_ingest_enabled(SrsConfDirective* ingest)
string SrsConfig::get_ingest_ffmpeg(SrsConfDirective* ingest)
{
if (!ingest) {
return "";
}
SrsConfDirective* conf = ingest->get("ffmpeg");
if (!conf) {
@ -2334,6 +2342,10 @@ string SrsConfig::get_ingest_ffmpeg(SrsConfDirective* ingest)
string SrsConfig::get_ingest_input_type(SrsConfDirective* ingest)
{
if (!ingest) {
return SRS_CONF_DEFAULT_INGEST_TYPE_FILE;
}
SrsConfDirective* conf = ingest->get("input");
if (!conf) {
@ -2351,6 +2363,10 @@ string SrsConfig::get_ingest_input_type(SrsConfDirective* ingest)
string SrsConfig::get_ingest_input_url(SrsConfDirective* ingest)
{
if (!ingest) {
return "";
}
SrsConfDirective* conf = ingest->get("input");
if (!conf) {

View file

@ -449,28 +449,33 @@ public:
* whether gop_cache is enabled of vhost.
* gop_cache used to cache last gop, for client to fast startup.
* @return true when gop_cache is ok; otherwise, false.
* @remark, default true.
*/
virtual bool get_gop_cache(std::string vhost);
/**
* whether atc is enabled of vhost.
* atc always use encoder timestamp, SRS never adjust the time.
* @return true when atc is ok; otherwise, false.
* @remark, default false.
*/
virtual bool get_atc(std::string vhost);
/**
* whether atc_auto is enabled of vhost.
* atc_auto used to auto enable atc, when metadata specified the bravo_atc.
* @return true when atc_auto is ok; otherwise, false.
* @remark, default true.
*/
virtual bool get_atc_auto(std::string vhost);
/**
* get the time_jitter algorithm.
* @return the time_jitter algorithm, defined in SrsRtmpJitterAlgorithm.
* @remark, default full.
*/
virtual int get_time_jitter(std::string vhost);
/**
* get the cache queue length, in seconds.
* when exceed the queue length, drop packet util I frame.
* @remark, default 10.
*/
virtual double get_queue_length(std::string vhost);
/**
@ -478,20 +483,24 @@ public:
* each args of directive is a refer config.
* when the client refer(pageUrl) not match the refer config,
* SRS will reject the connection.
* @remark, default NULL.
*/
virtual SrsConfDirective* get_refer(std::string vhost);
/**
* get the play refer, refer for play clients.
* @remark, default NULL.
*/
virtual SrsConfDirective* get_refer_play(std::string vhost);
/**
* get the publish refer, refer for publish clients.
* @remark, default NULL.
*/
virtual SrsConfDirective* get_refer_publish(std::string vhost);
/**
* get the chunk size of vhost.
* @param vhost, the vhost to get the chunk size. use global if not specified.
* empty string to get the global.
* @remark, default 60000.
*/
virtual int get_chunk_size(std::string vhost);
private: