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

refine config, add comments

This commit is contained in:
winlin 2014-07-18 12:12:25 +08:00
parent a5f4323ea8
commit 2f0a72d7d1
3 changed files with 64 additions and 52 deletions

View file

@ -2549,17 +2549,17 @@ int SrsConfig::get_dvr_time_jitter(string vhost)
return _srs_time_jitter_string2int(time_jitter); return _srs_time_jitter_string2int(time_jitter);
} }
SrsConfDirective* SrsConfig::get_http_api()
{
return root->get("http_api");
}
bool SrsConfig::get_http_api_enabled() bool SrsConfig::get_http_api_enabled()
{ {
SrsConfDirective* conf = get_http_api(); SrsConfDirective* conf = get_http_api();
return get_http_api_enabled(conf); return get_http_api_enabled(conf);
} }
SrsConfDirective* SrsConfig::get_http_api()
{
return root->get("http_api");
}
bool SrsConfig::get_http_api_enabled(SrsConfDirective* conf) bool SrsConfig::get_http_api_enabled(SrsConfDirective* conf)
{ {
if (!conf) { if (!conf) {
@ -2590,17 +2590,17 @@ int SrsConfig::get_http_api_listen()
return ::atoi(conf->arg0().c_str()); return ::atoi(conf->arg0().c_str());
} }
SrsConfDirective* SrsConfig::get_http_stream()
{
return root->get("http_stream");
}
bool SrsConfig::get_http_stream_enabled() bool SrsConfig::get_http_stream_enabled()
{ {
SrsConfDirective* conf = get_http_stream(); SrsConfDirective* conf = get_http_stream();
return get_http_stream_enabled(conf); return get_http_stream_enabled(conf);
} }
SrsConfDirective* SrsConfig::get_http_stream()
{
return root->get("http_stream");
}
bool SrsConfig::get_http_stream_enabled(SrsConfDirective* conf) bool SrsConfig::get_http_stream_enabled(SrsConfDirective* conf)
{ {
if (!conf) { if (!conf) {

View file

@ -712,159 +712,171 @@ public:
// log section // log section
public: public:
/** /**
* * whether log to file.
*/ */
virtual bool get_log_tank_file(); virtual bool get_log_tank_file();
/** /**
* * get the log level.
*/ */
virtual std::string get_log_level(); virtual std::string get_log_level();
/** /**
* * get the log file path.
*/ */
virtual std::string get_log_file(); virtual std::string get_log_file();
/** /**
* * whether ffmpeg log enabled
*/ */
virtual bool get_ffmpeg_log_enabled(); virtual bool get_ffmpeg_log_enabled();
/** /**
* * the ffmpeg log dir.
* @remark, /dev/null to disable it.
*/ */
virtual std::string get_ffmpeg_log_dir(); virtual std::string get_ffmpeg_log_dir();
// hls section // hls section
private: private:
/** /**
* * get the hls directive of vhost.
*/ */
virtual SrsConfDirective* get_hls(std::string vhost); virtual SrsConfDirective* get_hls(std::string vhost);
public: public:
/** /**
* * whether HLS is enabled.
*/ */
virtual bool get_hls_enabled(std::string vhost); virtual bool get_hls_enabled(std::string vhost);
/** /**
* * get the HLS ts/m3u8 file store path.
*/ */
virtual std::string get_hls_path(std::string vhost); virtual std::string get_hls_path(std::string vhost);
/** /**
* * get the hls fragment time, in seconds.
* a fragment is a ts file.
*/ */
virtual double get_hls_fragment(std::string vhost); virtual double get_hls_fragment(std::string vhost);
/** /**
* * get the hls window time, in seconds.
* a window is a set of ts, the ts collection in m3u8.
* @remark SRS will delete the ts exceed the window.
*/ */
virtual double get_hls_window(std::string vhost); virtual double get_hls_window(std::string vhost);
// dvr section // dvr section
private: private:
/** /**
* * get the dvr directive.
*/ */
virtual SrsConfDirective* get_dvr(std::string vhost); virtual SrsConfDirective* get_dvr(std::string vhost);
public: public:
/** /**
* * whether dvr is enabled.
*/ */
virtual bool get_dvr_enabled(std::string vhost); virtual bool get_dvr_enabled(std::string vhost);
/** /**
* * get the dvr path, the flv file to save in.
*/ */
virtual std::string get_dvr_path(std::string vhost); virtual std::string get_dvr_path(std::string vhost);
/** /**
* * get the plan of dvr, how to reap the flv file.
*/ */
virtual std::string get_dvr_plan(std::string vhost); virtual std::string get_dvr_plan(std::string vhost);
/** /**
* * get the duration of dvr flv, for segment plan.
*/ */
virtual int get_dvr_duration(std::string vhost); virtual int get_dvr_duration(std::string vhost);
/** /**
* * get the time_jitter algorithm for dvr.
*/ */
virtual int get_dvr_time_jitter(std::string vhost); virtual int get_dvr_time_jitter(std::string vhost);
// http api section // http api section
private: private:
/** /**
* * get the http api directive.
*/ */
virtual SrsConfDirective* get_http_api(); virtual SrsConfDirective* get_http_api();
/**
* whether http api enabled
*/
virtual bool get_http_api_enabled(SrsConfDirective* conf);
public: public:
/** /**
* * whether http api enabled.
*/ */
virtual bool get_http_api_enabled(); virtual bool get_http_api_enabled();
/** /**
* * get the http api listen port.
*/
virtual bool get_http_api_enabled(SrsConfDirective* conf);
/**
*
*/ */
virtual int get_http_api_listen(); virtual int get_http_api_listen();
// http stream section // http stream section
private: private:
/** /**
* * get the http stream directive.
*/ */
virtual SrsConfDirective* get_http_stream(); virtual SrsConfDirective* get_http_stream();
/**
* whether http stream enabled.
*/
virtual bool get_http_stream_enabled(SrsConfDirective* conf);
public: public:
/** /**
* * whether http stream enabled.
*/ */
virtual bool get_http_stream_enabled(); virtual bool get_http_stream_enabled();
/** /**
* * get the http stream listen port.
*/
virtual bool get_http_stream_enabled(SrsConfDirective* conf);
/**
*
*/ */
virtual int get_http_stream_listen(); virtual int get_http_stream_listen();
/** /**
* * get the http stream root dir.
*/ */
virtual std::string get_http_stream_dir(); virtual std::string get_http_stream_dir();
public: public:
/** /**
* * get whether vhost enabled http stream
*/ */
virtual bool get_vhost_http_enabled(std::string vhost); virtual bool get_vhost_http_enabled(std::string vhost);
/** /**
* * get the http mount point for vhost,
* vhost can use sub dir of http.
* for example, http://server/vhost1/live/livestream
* where the vhost1 is mount point for vhost1.
*/ */
virtual std::string get_vhost_http_mount(std::string vhost); virtual std::string get_vhost_http_mount(std::string vhost);
/** /**
* * get the http dir for vhost.
* the http dir of vhost will mount to the mount point of vhost.
* for example, http://server/vhost1/live/livestream
* where the vhost1 is mount point for vhost1,
* and vhost1 dir is specified by this http dir.
*/ */
virtual std::string get_vhost_http_dir(std::string vhost); virtual std::string get_vhost_http_dir(std::string vhost);
// http heartbeart section // http heartbeart section
private: private:
/** /**
* * get the heartbeat directive.
*/ */
virtual SrsConfDirective* get_heartbeart(); virtual SrsConfDirective* get_heartbeart();
public: public:
/** /**
* * whether heartbeat enabled.
*/ */
virtual bool get_heartbeat_enabled(); virtual bool get_heartbeat_enabled();
/** /**
* * get the heartbeat interval, in ms.
*/ */
virtual int64_t get_heartbeat_interval(); virtual int64_t get_heartbeat_interval();
/** /**
* * get the heartbeat report url.
*/ */
virtual std::string get_heartbeat_url(); virtual std::string get_heartbeat_url();
/** /**
* * get the device id of heartbeat, to report to server.
*/ */
virtual std::string get_heartbeat_device_id(); virtual std::string get_heartbeat_device_id();
/** /**
* * get the network device index, to report to server.
* for example, 0 means the eth0 maybe.
*/ */
virtual int get_heartbeat_device_index(); virtual int get_heartbeat_device_index();
/** /**
* * whether report with summaries of http api: /api/v1/summaries.
*/ */
virtual bool get_heartbeat_summaries(); virtual bool get_heartbeat_summaries();
}; };

View file

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version // current release version
#define VERSION_MAJOR "0" #define VERSION_MAJOR "0"
#define VERSION_MINOR "9" #define VERSION_MINOR "9"
#define VERSION_REVISION "161" #define VERSION_REVISION "162"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info. // server info.
#define RTMP_SIG_SRS_KEY "SRS" #define RTMP_SIG_SRS_KEY "SRS"