From 93dfadbd68ae60bfa82e59a1be4caf6b63311937 Mon Sep 17 00:00:00 2001 From: winlin Date: Wed, 21 Aug 2024 10:58:39 +0800 Subject: [PATCH] Config: Define static for valgrind detection. --- trunk/src/app/srs_app_config.cpp | 551 ++++++++++++++++--------------- 1 file changed, 277 insertions(+), 274 deletions(-) diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 0731f3cd2bc..5ad82d22f77 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -42,6 +42,9 @@ using namespace std; using namespace srs_internal; +// You can disable the static to be friendly to valgrind. +#define SRS_CXX_STATIC static + // @global the version to identify the core. const char* _srs_version = "XCORE-" RTMP_SIG_SRS_SERVER; @@ -323,7 +326,7 @@ bool srs_stream_caster_is_gb28181(string caster) bool srs_config_apply_filter(SrsConfDirective* dvr_apply, SrsRequest* req) { - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; if (!dvr_apply || dvr_apply->args.empty()) { return DEFAULT; @@ -984,13 +987,13 @@ srs_error_t SrsConfDirective::parse(SrsConfigBuffer* buffer, SrsConfig* conf) srs_error_t SrsConfDirective::persistence(SrsFileWriter* writer, int level) { srs_error_t err = srs_success; - - static char SPACE = SRS_CONSTS_SP; - static char SEMICOLON = SRS_CONSTS_SE; - static char LF = SRS_CONSTS_LF; - static char LB = SRS_CONSTS_LB; - static char RB = SRS_CONSTS_RB; - static const char* INDENT = " "; + + SRS_CXX_STATIC char SPACE = SRS_CONSTS_SP; + SRS_CXX_STATIC char SEMICOLON = SRS_CONSTS_SE; + SRS_CXX_STATIC char LF = SRS_CONSTS_LF; + SRS_CXX_STATIC char LB = SRS_CONSTS_LB; + SRS_CXX_STATIC char RB = SRS_CONSTS_RB; + SRS_CXX_STATIC const char* INDENT = " "; // for level0 directive, only contains sub directives. if (level > 0) { @@ -2933,7 +2936,7 @@ bool SrsConfig::get_in_docker() { SRS_OVERWRITE_BY_ENV_BOOL("srs.in_docker"); // SRS_IN_DOCKER - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("in_docker"); if (!conf) { @@ -2945,7 +2948,7 @@ bool SrsConfig::get_in_docker() bool SrsConfig::is_full_config() { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("is_full"); if (!conf) { @@ -2978,7 +2981,7 @@ string srs_try_read_file(string path) { return ""; } - static char buf[1024]; + SRS_CXX_STATIC char buf[1024]; ssize_t nn = 0; if ((err = r.read(buf, sizeof(buf), &nn)) != srs_success) { srs_freep(err); @@ -3008,7 +3011,7 @@ void srs_try_write_file(string path, string content) { string SrsConfig::get_server_id() { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; // Try to read DEFAULT from server id file. if (DEFAULT.empty()) { @@ -3046,7 +3049,7 @@ int SrsConfig::get_max_connections() { SRS_OVERWRITE_BY_ENV_INT("srs.max_connections"); // SRS_MAX_CONNECTIONS - static int DEFAULT = 1000; + SRS_CXX_STATIC int DEFAULT = 1000; SrsConfDirective* conf = root->get("max_connections"); if (!conf || conf->arg0().empty()) { @@ -3080,7 +3083,7 @@ string SrsConfig::get_pid_file() { SRS_OVERWRITE_BY_ENV_STRING("srs.pid"); // SRS_PID - static string DEFAULT = "./objs/srs.pid"; + SRS_CXX_STATIC string DEFAULT = "./objs/srs.pid"; SrsConfDirective* conf = root->get("pid"); @@ -3095,7 +3098,7 @@ srs_utime_t SrsConfig::get_pithy_print() { SRS_OVERWRITE_BY_ENV_MILLISECONDS("srs.pithy_print_ms"); // SRS_PITHY_PRINT_MS - static srs_utime_t DEFAULT = 10 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 10 * SRS_UTIME_SECONDS; SrsConfDirective* conf = root->get("pithy_print_ms"); if (!conf || conf->arg0().empty()) { @@ -3109,7 +3112,7 @@ bool SrsConfig::get_utc_time() { SRS_OVERWRITE_BY_ENV_BOOL("srs.utc_time"); // SRS_UTC_TIME - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("utc_time"); if (!conf || conf->arg0().empty()) { @@ -3123,7 +3126,7 @@ string SrsConfig::get_work_dir() { SRS_OVERWRITE_BY_ENV_STRING("srs.work_dir"); // SRS_WORK_DIR - static string DEFAULT = "./"; + SRS_CXX_STATIC string DEFAULT = "./"; SrsConfDirective* conf = root->get("work_dir"); if( !conf || conf->arg0().empty()) { @@ -3137,7 +3140,7 @@ bool SrsConfig::get_asprocess() { SRS_OVERWRITE_BY_ENV_BOOL("srs.asprocess"); // SRS_ASPROCESS - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("asprocess"); if (!conf || conf->arg0().empty()) { @@ -3151,7 +3154,7 @@ bool SrsConfig::whether_query_latest_version() { SRS_OVERWRITE_BY_ENV_BOOL("srs.query_latest_version"); // SRS_QUERY_LATEST_VERSION - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("query_latest_version"); if (!conf) { @@ -3165,7 +3168,7 @@ srs_utime_t SrsConfig::first_wait_for_qlv() { SRS_OVERWRITE_BY_ENV_SECONDS("srs.first_wait_for_qlv"); // SRS_FIRST_WAIT_FOR_QLV - static srs_utime_t DEFAULT = 5 * 60 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 5 * 60 * SRS_UTIME_SECONDS; SrsConfDirective* conf = root->get("first_wait_for_qlv"); if (!conf) { @@ -3179,7 +3182,7 @@ bool SrsConfig::empty_ip_ok() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.empty_ip_ok"); // SRS_EMPTY_IP_OK - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("empty_ip_ok"); if (!conf || conf->arg0().empty()) { @@ -3193,7 +3196,7 @@ srs_utime_t SrsConfig::get_grace_start_wait() { SRS_OVERWRITE_BY_ENV_MILLISECONDS("srs.grace_start_wait"); // SRS_GRACE_START_WAIT - static srs_utime_t DEFAULT = 2300 * SRS_UTIME_MILLISECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 2300 * SRS_UTIME_MILLISECONDS; SrsConfDirective* conf = root->get("grace_start_wait"); if (!conf || conf->arg0().empty()) { @@ -3207,7 +3210,7 @@ srs_utime_t SrsConfig::get_grace_final_wait() { SRS_OVERWRITE_BY_ENV_MILLISECONDS("srs.grace_final_wait"); // SRS_GRACE_FINAL_WAIT - static srs_utime_t DEFAULT = 3200 * SRS_UTIME_MILLISECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 3200 * SRS_UTIME_MILLISECONDS; SrsConfDirective* conf = root->get("grace_final_wait"); if (!conf || conf->arg0().empty()) { @@ -3221,7 +3224,7 @@ bool SrsConfig::is_force_grace_quit() { SRS_OVERWRITE_BY_ENV_BOOL("srs.force_grace_quit"); // SRS_FORCE_GRACE_QUIT - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("force_grace_quit"); if (!conf || conf->arg0().empty()) { @@ -3235,7 +3238,7 @@ bool SrsConfig::disable_daemon_for_docker() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.disable_daemon_for_docker"); // SRS_DISABLE_DAEMON_FOR_DOCKER - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("disable_daemon_for_docker"); if (!conf || conf->arg0().empty()) { @@ -3249,7 +3252,7 @@ bool SrsConfig::inotify_auto_reload() { SRS_OVERWRITE_BY_ENV_BOOL("srs.inotify_auto_reload"); // SRS_INOTIFY_AUTO_RELOAD - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("inotify_auto_reload"); if (!conf || conf->arg0().empty()) { @@ -3263,7 +3266,7 @@ bool SrsConfig::auto_reload_for_docker() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.auto_reload_for_docker"); // SRS_AUTO_RELOAD_FOR_DOCKER - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("auto_reload_for_docker"); if (!conf || conf->arg0().empty()) { @@ -3283,7 +3286,7 @@ double SrsConfig::tcmalloc_release_rate() return trr; } - static double DEFAULT = SRS_PERF_TCMALLOC_RELEASE_RATE; + SRS_CXX_STATIC double DEFAULT = SRS_PERF_TCMALLOC_RELEASE_RATE; SrsConfDirective* conf = root->get("tcmalloc_release_rate"); if (!conf || conf->arg0().empty()) { @@ -3300,7 +3303,7 @@ srs_utime_t SrsConfig::get_threads_interval() { SRS_OVERWRITE_BY_ENV_SECONDS("srs.threads.interval"); // SRS_THREADS_INTERVAL - static srs_utime_t DEFAULT = 5 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 5 * SRS_UTIME_SECONDS; SrsConfDirective* conf = root->get("threads"); if (!conf) { @@ -3324,7 +3327,7 @@ bool SrsConfig::get_circuit_breaker() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.circuit_breaker.enabled"); // SRS_CIRCUIT_BREAKER_ENABLED - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("circuit_breaker"); if (!conf) { @@ -3343,7 +3346,7 @@ int SrsConfig::get_high_threshold() { SRS_OVERWRITE_BY_ENV_INT("srs.circuit_breaker.high_threshold"); // SRS_CIRCUIT_BREAKER_HIGH_THRESHOLD - static int DEFAULT = 90; + SRS_CXX_STATIC int DEFAULT = 90; SrsConfDirective* conf = root->get("circuit_breaker"); if (!conf) { @@ -3362,7 +3365,7 @@ int SrsConfig::get_high_pulse() { SRS_OVERWRITE_BY_ENV_INT("srs.circuit_breaker.high_pulse"); // SRS_CIRCUIT_BREAKER_HIGH_PULSE - static int DEFAULT = 2; + SRS_CXX_STATIC int DEFAULT = 2; SrsConfDirective* conf = root->get("circuit_breaker"); if (!conf) { @@ -3381,7 +3384,7 @@ int SrsConfig::get_critical_threshold() { SRS_OVERWRITE_BY_ENV_INT("srs.circuit_breaker.critical_threshold"); // SRS_CIRCUIT_BREAKER_CRITICAL_THRESHOLD - static int DEFAULT = 95; + SRS_CXX_STATIC int DEFAULT = 95; SrsConfDirective* conf = root->get("circuit_breaker"); if (!conf) { @@ -3400,7 +3403,7 @@ int SrsConfig::get_critical_pulse() { SRS_OVERWRITE_BY_ENV_INT("srs.circuit_breaker.critical_pulse"); // SRS_CIRCUIT_BREAKER_CRITICAL_PULSE - static int DEFAULT = 1; + SRS_CXX_STATIC int DEFAULT = 1; SrsConfDirective* conf = root->get("circuit_breaker"); if (!conf) { @@ -3419,7 +3422,7 @@ int SrsConfig::get_dying_threshold() { SRS_OVERWRITE_BY_ENV_INT("srs.circuit_breaker.dying_threshold"); // SRS_CIRCUIT_BREAKER_DYING_THRESHOLD - static int DEFAULT = 99; + SRS_CXX_STATIC int DEFAULT = 99; SrsConfDirective* conf = root->get("circuit_breaker"); if (!conf) { @@ -3438,7 +3441,7 @@ int SrsConfig::get_dying_pulse() { SRS_OVERWRITE_BY_ENV_INT("srs.circuit_breaker.dying_pulse"); // SRS_CIRCUIT_BREAKER_DYING_PULSE - static int DEFAULT = 5; + SRS_CXX_STATIC int DEFAULT = 5; SrsConfDirective* conf = root->get("circuit_breaker"); if (!conf) { @@ -3457,7 +3460,7 @@ bool SrsConfig::get_tencentcloud_cls_enabled() { SRS_OVERWRITE_BY_ENV_BOOL("srs.tencentcloud_cls.enabled"); // SRS_TENCENTCLOUD_CLS_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3476,7 +3479,7 @@ bool SrsConfig::get_tencentcloud_cls_stat_heartbeat() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.tencentcloud_cls.stat_heartbeat"); // SRS_TENCENTCLOUD_CLS_STAT_HEARTBEAT - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3495,7 +3498,7 @@ bool SrsConfig::get_tencentcloud_cls_stat_streams() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.tencentcloud_cls.stat_streams"); // SRS_TENCENTCLOUD_CLS_STAT_STREAMS - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3514,7 +3517,7 @@ bool SrsConfig::get_tencentcloud_cls_debug_logging() { SRS_OVERWRITE_BY_ENV_BOOL("srs.tencentcloud_cls.debug_logging"); // SRS_TENCENTCLOUD_CLS_DEBUG_LOGGING - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3533,7 +3536,7 @@ int SrsConfig::get_tencentcloud_cls_heartbeat_ratio() { SRS_OVERWRITE_BY_ENV_INT("srs.tencentcloud_cls.heartbeat_ratio"); // SRS_TENCENTCLOUD_CLS_HEARTBEAT_RATIO - static int DEFAULT = 1; + SRS_CXX_STATIC int DEFAULT = 1; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3552,7 +3555,7 @@ int SrsConfig::get_tencentcloud_cls_streams_ratio() { SRS_OVERWRITE_BY_ENV_INT("srs.tencentcloud_cls.streams_ratio"); // SRS_TENCENTCLOUD_CLS_STREAMS_RATIO - static int DEFAULT = 1; + SRS_CXX_STATIC int DEFAULT = 1; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3571,7 +3574,7 @@ string SrsConfig::get_tencentcloud_cls_label() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_cls.label"); // SRS_TENCENTCLOUD_CLS_LABEL - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3590,7 +3593,7 @@ string SrsConfig::get_tencentcloud_cls_tag() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_cls.tag"); // SRS_TENCENTCLOUD_CLS_TAG - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3609,7 +3612,7 @@ string SrsConfig::get_tencentcloud_cls_secret_id() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_cls.secret_id"); // SRS_TENCENTCLOUD_CLS_SECRET_ID - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3628,7 +3631,7 @@ string SrsConfig::get_tencentcloud_cls_secret_key() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_cls.secret_key"); // SRS_TENCENTCLOUD_CLS_SECRET_KEY - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3647,7 +3650,7 @@ string SrsConfig::get_tencentcloud_cls_endpoint() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_cls.endpoint"); // SRS_TENCENTCLOUD_CLS_ENDPOINT - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3666,7 +3669,7 @@ string SrsConfig::get_tencentcloud_cls_topic_id() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_cls.topic_id"); // SRS_TENCENTCLOUD_CLS_TOPIC_ID - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("tencentcloud_cls"); if (!conf) { @@ -3685,7 +3688,7 @@ bool SrsConfig::get_tencentcloud_apm_enabled() { SRS_OVERWRITE_BY_ENV_BOOL("srs.tencentcloud_apm.enabled"); // SRS_TENCENTCLOUD_APM_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("tencentcloud_apm"); if (!conf) { @@ -3704,7 +3707,7 @@ string SrsConfig::get_tencentcloud_apm_team() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_apm.team"); // SRS_TENCENTCLOUD_APM_TEAM - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("tencentcloud_apm"); if (!conf) { @@ -3723,7 +3726,7 @@ string SrsConfig::get_tencentcloud_apm_token() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_apm.token"); // SRS_TENCENTCLOUD_APM_TOKEN - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("tencentcloud_apm"); if (!conf) { @@ -3742,7 +3745,7 @@ string SrsConfig::get_tencentcloud_apm_endpoint() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_apm.endpoint"); // SRS_TENCENTCLOUD_APM_ENDPOINT - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("tencentcloud_apm"); if (!conf) { @@ -3761,7 +3764,7 @@ string SrsConfig::get_tencentcloud_apm_service_name() { SRS_OVERWRITE_BY_ENV_STRING("srs.tencentcloud_apm.service_name"); // SRS_TENCENTCLOUD_APM_SERVICE_NAME - static string DEFAULT = "srs-server"; + SRS_CXX_STATIC string DEFAULT = "srs-server"; SrsConfDirective* conf = root->get("tencentcloud_apm"); if (!conf) { @@ -3780,7 +3783,7 @@ bool SrsConfig::get_tencentcloud_apm_debug_logging() { SRS_OVERWRITE_BY_ENV_BOOL("srs.tencentcloud_apm.debug_logging"); // SRS_TENCENTCLOUD_APM_DEBUG_LOGGING - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("tencentcloud_apm"); if (!conf) { @@ -3799,7 +3802,7 @@ bool SrsConfig::get_exporter_enabled() { SRS_OVERWRITE_BY_ENV_BOOL("srs.exporter.enabled"); // SRS_EXPORTER_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("exporter"); if (!conf) { @@ -3818,7 +3821,7 @@ string SrsConfig::get_exporter_listen() { SRS_OVERWRITE_BY_ENV_STRING("srs.exporter.listen"); // SRS_EXPORTER_LISTEN - static string DEFAULT = "9972"; + SRS_CXX_STATIC string DEFAULT = "9972"; SrsConfDirective* conf = root->get("exporter"); if (!conf) { @@ -3837,7 +3840,7 @@ string SrsConfig::get_exporter_label() { SRS_OVERWRITE_BY_ENV_STRING("srs.exporter.label"); // SRS_EXPORTER_LABEL - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("exporter"); if (!conf) { @@ -3856,7 +3859,7 @@ string SrsConfig::get_exporter_tag() { SRS_OVERWRITE_BY_ENV_STRING("srs.exporter.tag"); // SRS_EXPORTER_TAG - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("exporter"); if (!conf) { @@ -3892,7 +3895,7 @@ vector SrsConfig::get_stream_casters() bool SrsConfig::get_stream_caster_enabled(SrsConfDirective* conf) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; if (!conf) { return DEFAULT; @@ -3908,7 +3911,7 @@ bool SrsConfig::get_stream_caster_enabled(SrsConfDirective* conf) string SrsConfig::get_stream_caster_engine(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -3924,7 +3927,7 @@ string SrsConfig::get_stream_caster_engine(SrsConfDirective* conf) string SrsConfig::get_stream_caster_output(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -3940,7 +3943,7 @@ string SrsConfig::get_stream_caster_output(SrsConfDirective* conf) int SrsConfig::get_stream_caster_listen(SrsConfDirective* conf) { - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; if (!conf) { return DEFAULT; @@ -3956,7 +3959,7 @@ int SrsConfig::get_stream_caster_listen(SrsConfDirective* conf) bool SrsConfig::get_stream_caster_sip_enable(SrsConfDirective* conf) { - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; if (!conf) { return DEFAULT; @@ -3977,7 +3980,7 @@ bool SrsConfig::get_stream_caster_sip_enable(SrsConfDirective* conf) int SrsConfig::get_stream_caster_sip_listen(SrsConfDirective* conf) { - static int DEFAULT = 5060; + SRS_CXX_STATIC int DEFAULT = 5060; if (!conf) { return DEFAULT; @@ -3998,7 +4001,7 @@ int SrsConfig::get_stream_caster_sip_listen(SrsConfDirective* conf) srs_utime_t SrsConfig::get_stream_caster_sip_timeout(SrsConfDirective* conf) { - static srs_utime_t DEFAULT = 60 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 60 * SRS_UTIME_SECONDS; if (!conf) { return DEFAULT; @@ -4019,7 +4022,7 @@ srs_utime_t SrsConfig::get_stream_caster_sip_timeout(SrsConfDirective* conf) srs_utime_t SrsConfig::get_stream_caster_sip_reinvite(SrsConfDirective* conf) { - static srs_utime_t DEFAULT = 5 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 5 * SRS_UTIME_SECONDS; if (!conf) { return DEFAULT; @@ -4040,7 +4043,7 @@ srs_utime_t SrsConfig::get_stream_caster_sip_reinvite(SrsConfDirective* conf) std::string SrsConfig::get_stream_caster_sip_candidate(SrsConfDirective* conf) { - static string DEFAULT = "*"; + SRS_CXX_STATIC string DEFAULT = "*"; if (!conf) { return DEFAULT; @@ -4079,7 +4082,7 @@ bool SrsConfig::get_rtc_server_enabled(SrsConfDirective* conf) { SRS_OVERWRITE_BY_ENV_BOOL("srs.rtc_server.enabled"); // SRS_RTC_SERVER_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; if (!conf) { return DEFAULT; @@ -4097,7 +4100,7 @@ int SrsConfig::get_rtc_server_listen() { SRS_OVERWRITE_BY_ENV_INT("srs.rtc_server.listen"); // SRS_RTC_SERVER_LISTEN - static int DEFAULT = 8000; + SRS_CXX_STATIC int DEFAULT = 8000; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4121,7 +4124,7 @@ std::string SrsConfig::get_rtc_server_candidates() SRS_OVERWRITE_BY_ENV_STRING(eval); } - static string DEFAULT = "*"; + SRS_CXX_STATIC string DEFAULT = "*"; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4150,7 +4153,7 @@ bool SrsConfig::get_api_as_candidates() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.rtc_server.api_as_candidates"); // SRS_RTC_SERVER_API_AS_CANDIDATES - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4169,7 +4172,7 @@ bool SrsConfig::get_resolve_api_domain() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.rtc_server.resolve_api_domain"); // SRS_RTC_SERVER_RESOLVE_API_DOMAIN - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4188,7 +4191,7 @@ bool SrsConfig::get_keep_api_domain() { SRS_OVERWRITE_BY_ENV_BOOL("srs.rtc_server.keep_api_domain"); // SRS_RTC_SERVER_KEEP_API_DOMAIN - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4207,7 +4210,7 @@ bool SrsConfig::get_use_auto_detect_network_ip() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.rtc_server.use_auto_detect_network_ip"); // SRS_RTC_SERVER_USE_AUTO_DETECT_NETWORK_IP - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4226,7 +4229,7 @@ bool SrsConfig::get_rtc_server_tcp_enabled() { SRS_OVERWRITE_BY_ENV_BOOL("srs.rtc_server.tcp.enabled"); // SRS_RTC_SERVER_TCP_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4250,7 +4253,7 @@ int SrsConfig::get_rtc_server_tcp_listen() { SRS_OVERWRITE_BY_ENV_INT("srs.rtc_server.tcp.listen"); // SRS_RTC_SERVER_TCP_LISTEN - static int DEFAULT = 8000; + SRS_CXX_STATIC int DEFAULT = 8000; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4274,7 +4277,7 @@ std::string SrsConfig::get_rtc_server_protocol() { SRS_OVERWRITE_BY_ENV_STRING("srs.rtc_server.protocol"); // SRS_RTC_SERVER_PROTOCOL - static string DEFAULT = "udp"; + SRS_CXX_STATIC string DEFAULT = "udp"; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4293,7 +4296,7 @@ std::string SrsConfig::get_rtc_server_ip_family() { SRS_OVERWRITE_BY_ENV_STRING("srs.rtc_server.ip_family"); // SRS_RTC_SERVER_IP_FAMILY - static string DEFAULT = "ipv4"; + SRS_CXX_STATIC string DEFAULT = "ipv4"; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4312,7 +4315,7 @@ bool SrsConfig::get_rtc_server_ecdsa() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.rtc_server.ecdsa"); // SRS_RTC_SERVER_ECDSA - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4331,7 +4334,7 @@ bool SrsConfig::get_rtc_server_encrypt() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.rtc_server.encrypt"); // SRS_RTC_SERVER_ENCRYPT - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4364,7 +4367,7 @@ int SrsConfig::get_rtc_server_reuseport2() { SRS_OVERWRITE_BY_ENV_INT("srs.rtc_server.reuseport"); // SRS_RTC_SERVER_REUSEPORT - static int DEFAULT = 1; + SRS_CXX_STATIC int DEFAULT = 1; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4383,7 +4386,7 @@ bool SrsConfig::get_rtc_server_merge_nalus() { SRS_OVERWRITE_BY_ENV_BOOL("srs.rtc_server.merge_nalus"); // SRS_RTC_SERVER_MERGE_NALUS - static int DEFAULT = false; + SRS_CXX_STATIC int DEFAULT = false; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4402,7 +4405,7 @@ bool SrsConfig::get_rtc_server_black_hole() { SRS_OVERWRITE_BY_ENV_BOOL("srs.rtc_server.black_hole.enabled"); // SRS_RTC_SERVER_BLACK_HOLE_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4426,7 +4429,7 @@ std::string SrsConfig::get_rtc_server_black_hole_addr() { SRS_OVERWRITE_BY_ENV_STRING("srs.rtc_server.black_hole.addr"); // SRS_RTC_SERVER_BLACK_HOLE_ADDR - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) { @@ -4456,7 +4459,7 @@ bool SrsConfig::get_rtc_enabled(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.rtc.enabled"); // SRS_VHOST_RTC_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_rtc(vhost); @@ -4476,7 +4479,7 @@ bool SrsConfig::get_rtc_keep_bframe(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.rtc.keep_bframe"); // SRS_VHOST_RTC_KEEP_BFRAME - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_rtc(vhost); @@ -4496,7 +4499,7 @@ bool SrsConfig::get_rtc_keep_avc_nalu_sei(std::string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.rtc.keep_avc_nalu_sei"); // SRS_VHOST_RTC_KEEP_AVC_NALU_SEI - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_rtc(vhost); @@ -4516,7 +4519,7 @@ bool SrsConfig::get_rtc_from_rtmp(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.rtc.rtmp_to_rtc"); // SRS_VHOST_RTC_RTMP_TO_RTC - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_rtc(vhost); @@ -4536,7 +4539,7 @@ srs_utime_t SrsConfig::get_rtc_stun_timeout(string vhost) { SRS_OVERWRITE_BY_ENV_SECONDS("srs.vhost.rtc.stun_timeout"); // SRS_VHOST_RTC_STUN_TIMEOUT - static srs_utime_t DEFAULT = 30 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 30 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_rtc(vhost); @@ -4556,7 +4559,7 @@ bool SrsConfig::get_rtc_stun_strict_check(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.rtc.stun_strict_check"); // SRS_VHOST_RTC_STUN_STRICT_CHECK - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_rtc(vhost); @@ -4576,7 +4579,7 @@ std::string SrsConfig::get_rtc_dtls_role(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.rtc.dtls_role"); // SRS_VHOST_RTC_DTLS_ROLE - static std::string DEFAULT = "passive"; + SRS_CXX_STATIC std::string DEFAULT = "passive"; SrsConfDirective* conf = get_rtc(vhost); @@ -4596,7 +4599,7 @@ std::string SrsConfig::get_rtc_dtls_version(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.rtc.dtls_version"); // SRS_VHOST_RTC_DTLS_VERSION - static std::string DEFAULT = "auto"; + SRS_CXX_STATIC std::string DEFAULT = "auto"; SrsConfDirective* conf = get_rtc(vhost); @@ -4616,7 +4619,7 @@ int SrsConfig::get_rtc_drop_for_pt(string vhost) { SRS_OVERWRITE_BY_ENV_INT("srs.vhost.rtc.drop_for_pt"); // SRS_VHOST_RTC_DROP_FOR_PT - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; SrsConfDirective* conf = get_rtc(vhost); if (!conf) { @@ -4635,7 +4638,7 @@ bool SrsConfig::get_rtc_to_rtmp(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.rtc.rtc_to_rtmp"); // SRS_VHOST_RTC_RTC_TO_RTMP - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_rtc(vhost); if (!conf) { @@ -4652,7 +4655,7 @@ bool SrsConfig::get_rtc_to_rtmp(string vhost) srs_utime_t SrsConfig::get_rtc_pli_for_rtmp(string vhost) { - static srs_utime_t DEFAULT = 6 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 6 * SRS_UTIME_SECONDS; srs_utime_t v = 0; if (!srs_getenv("srs.vhost.rtc.pli_for_rtmp").empty()) { // SRS_VHOST_RTC_PLI_FOR_RTMP @@ -4683,7 +4686,7 @@ bool SrsConfig::get_rtc_nack_enabled(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.rtc.nack"); // SRS_VHOST_RTC_NACK - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_rtc(vhost); if (!conf) { @@ -4702,7 +4705,7 @@ bool SrsConfig::get_rtc_nack_no_copy(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.rtc.nack_no_copy"); // SRS_VHOST_RTC_NACK_NO_COPY - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_rtc(vhost); if (!conf) { @@ -4721,7 +4724,7 @@ bool SrsConfig::get_rtc_twcc_enabled(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.rtc.twcc"); // SRS_VHOST_RTC_TWCC - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_rtc(vhost); if (!conf) { @@ -4738,7 +4741,7 @@ bool SrsConfig::get_rtc_twcc_enabled(string vhost) int SrsConfig::get_rtc_opus_bitrate(string vhost) { - static int DEFAULT = 48000; + SRS_CXX_STATIC int DEFAULT = 48000; string opus_bitrate = srs_getenv("srs.vhost.rtc.opus_bitrate"); // SRS_VHOST_RTC_OPUS_BITRATE if (!opus_bitrate.empty()) { @@ -4772,7 +4775,7 @@ int SrsConfig::get_rtc_opus_bitrate(string vhost) int SrsConfig::get_rtc_aac_bitrate(string vhost) { - static int DEFAULT = 48000; + SRS_CXX_STATIC int DEFAULT = 48000; string aac_bitrate = srs_getenv("srs.vhost.rtc.aac_bitrate"); // SRS_VHOST_RTC_AAC_BITRATE if (!aac_bitrate.empty()) { @@ -4851,7 +4854,7 @@ bool SrsConfig::get_vhost_enabled(string vhost) bool SrsConfig::get_vhost_enabled(SrsConfDirective* conf) { - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; // false for NULL vhost. if (!conf) { @@ -4894,7 +4897,7 @@ int SrsConfig::get_gop_cache_max_frames(string vhost) { SRS_OVERWRITE_BY_ENV_INT("srs.vhost.play.gop_cache_max_frames"); // SRS_VHOST_PLAY_GOP_CACHE_MAX_FRAMES - static int DEFAULT = 2500; + SRS_CXX_STATIC int DEFAULT = 2500; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -4917,7 +4920,7 @@ int SrsConfig::get_gop_cache_max_frames(string vhost) bool SrsConfig::get_debug_srs_upnode(string vhost) { - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -4941,7 +4944,7 @@ bool SrsConfig::get_atc(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.play.atc"); // SRS_VHOST_PLAY_ATC - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -4965,7 +4968,7 @@ bool SrsConfig::get_atc_auto(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.play.atc_auto"); // SRS_VHOST_PLAY_ATC_AUTO - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -4991,7 +4994,7 @@ int SrsConfig::get_time_jitter(string vhost) return srs_time_jitter_string2int(srs_getenv("srs.vhost.play.time_jitter")); } - static string DEFAULT = "full"; + SRS_CXX_STATIC string DEFAULT = "full"; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5015,7 +5018,7 @@ bool SrsConfig::get_mix_correct(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.play.mix_correct"); // SRS_VHOST_PLAY_MIX_CORRECT - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5039,7 +5042,7 @@ srs_utime_t SrsConfig::get_queue_length(string vhost) { SRS_OVERWRITE_BY_ENV_SECONDS("srs.vhost.play.queue_length"); // SRS_VHOST_PLAY_QUEUE_LENGTH - static srs_utime_t DEFAULT = SRS_PERF_PLAY_QUEUE; + SRS_CXX_STATIC srs_utime_t DEFAULT = SRS_PERF_PLAY_QUEUE; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5061,7 +5064,7 @@ srs_utime_t SrsConfig::get_queue_length(string vhost) bool SrsConfig::get_refer_enabled(string vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5083,7 +5086,7 @@ bool SrsConfig::get_refer_enabled(string vhost) SrsConfDirective* SrsConfig::get_refer_all(string vhost) { - static SrsConfDirective* DEFAULT = NULL; + SRS_CXX_STATIC SrsConfDirective* DEFAULT = NULL; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5100,7 +5103,7 @@ SrsConfDirective* SrsConfig::get_refer_all(string vhost) SrsConfDirective* SrsConfig::get_refer_play(string vhost) { - static SrsConfDirective* DEFAULT = NULL; + SRS_CXX_STATIC SrsConfDirective* DEFAULT = NULL; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5117,7 +5120,7 @@ SrsConfDirective* SrsConfig::get_refer_play(string vhost) SrsConfDirective* SrsConfig::get_refer_publish(string vhost) { - static SrsConfDirective* DEFAULT = NULL; + SRS_CXX_STATIC SrsConfDirective* DEFAULT = NULL; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5136,7 +5139,7 @@ int SrsConfig::get_in_ack_size(string vhost) { SRS_OVERWRITE_BY_ENV_INT("srs.vhost.in_ack_size"); // SRS_VHOST_IN_ACK_SIZE - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5155,7 +5158,7 @@ int SrsConfig::get_out_ack_size(string vhost) { SRS_OVERWRITE_BY_ENV_INT("srs.vhost.out_ack_size"); // SRS_VHOST_OUT_ACK_SIZE - static int DEFAULT = 2500000; + SRS_CXX_STATIC int DEFAULT = 2500000; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5199,7 +5202,7 @@ bool SrsConfig::get_parse_sps(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.publish.parse_sps"); // SRS_VHOST_PUBLISH_PARSE_SPS - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_vhost(vhost); @@ -5224,7 +5227,7 @@ bool SrsConfig::try_annexb_first(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.publish.try_annexb_first"); // SRS_VHOST_PUBLISH_TRY_ANNEXB_FIRST - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_vhost(vhost); @@ -5271,7 +5274,7 @@ srs_utime_t SrsConfig::get_mr_sleep(string vhost) { SRS_OVERWRITE_BY_ENV_MILLISECONDS("srs.vhost.publish.mr_latency"); // SRS_VHOST_PUBLISH_MR_LATENCY - static srs_utime_t DEFAULT = SRS_PERF_MR_SLEEP; + SRS_CXX_STATIC srs_utime_t DEFAULT = SRS_PERF_MR_SLEEP; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5303,8 +5306,8 @@ srs_utime_t SrsConfig::get_mw_sleep(string vhost, bool is_rtc) return (srs_utime_t)(v * SRS_UTIME_MILLISECONDS); } - static srs_utime_t SYS_DEFAULT = SRS_PERF_MW_SLEEP; - static srs_utime_t RTC_DEFAULT = 0; + SRS_CXX_STATIC srs_utime_t SYS_DEFAULT = SRS_PERF_MW_SLEEP; + SRS_CXX_STATIC srs_utime_t RTC_DEFAULT = 0; srs_utime_t DEFAULT = is_rtc? RTC_DEFAULT : SYS_DEFAULT; @@ -5384,8 +5387,8 @@ bool SrsConfig::get_realtime_enabled(string vhost, bool is_rtc) SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.min_latency"); } - static bool SYS_DEFAULT = SRS_PERF_MIN_LATENCY_ENABLED; - static bool RTC_DEFAULT = true; + SRS_CXX_STATIC bool SYS_DEFAULT = SRS_PERF_MIN_LATENCY_ENABLED; + SRS_CXX_STATIC bool RTC_DEFAULT = true; bool DEFAULT = is_rtc? RTC_DEFAULT : SYS_DEFAULT; @@ -5410,7 +5413,7 @@ bool SrsConfig::get_tcp_nodelay(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.tcp_nodelay"); // SRS_VHOST_TCP_NODELAY - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5429,7 +5432,7 @@ srs_utime_t SrsConfig::get_send_min_interval(string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_MILLISECONDS("srs.vhost.play.send_min_interval"); // SRS_VHOST_PLAY_SEND_MIN_INTERVAL - static srs_utime_t DEFAULT = 0; + SRS_CXX_STATIC srs_utime_t DEFAULT = 0; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5453,7 +5456,7 @@ bool SrsConfig::get_reduce_sequence_header(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.play.reduce_sequence_header"); // SRS_VHOST_PLAY_REDUCE_SEQUENCE_HEADER - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5478,7 +5481,7 @@ srs_utime_t SrsConfig::get_publish_1stpkt_timeout(string vhost) SRS_OVERWRITE_BY_ENV_MILLISECONDS("srs.vhost.publish.firstpkt_timeout"); // SRS_VHOST_PUBLISH_FIRSTPKT_TIMEOUT // when no msg recevied for publisher, use larger timeout. - static srs_utime_t DEFAULT = 20 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 20 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5505,7 +5508,7 @@ srs_utime_t SrsConfig::get_publish_normal_timeout(string vhost) // the timeout for publish recv. // we must use more smaller timeout, for the recv never know the status // of underlayer socket. - static srs_utime_t DEFAULT = 5 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 5 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5534,7 +5537,7 @@ srs_utime_t SrsConfig::get_publish_kickoff_for_idle(SrsConfDirective* vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.publish.kickoff_for_idle"); // SRS_VHOST_PUBLISH_KICKOFF_FOR_IDLE - static srs_utime_t DEFAULT = 0 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 0 * SRS_UTIME_SECONDS; SrsConfDirective* conf = vhost; if (!conf) { @@ -5567,7 +5570,7 @@ int SrsConfig::get_global_chunk_size() } bool SrsConfig::get_forward_enabled(string vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5579,7 +5582,7 @@ bool SrsConfig::get_forward_enabled(string vhost) { bool SrsConfig::get_forward_enabled(SrsConfDirective* vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost->get("forward"); if (!conf) { @@ -5638,7 +5641,7 @@ bool SrsConfig::get_vhost_http_hooks_enabled(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.http_hooks.enabled"); // SRS_VHOST_HTTP_HOOKS_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5652,7 +5655,7 @@ bool SrsConfig::get_vhost_http_hooks_enabled(SrsConfDirective* vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.http_hooks.enabled"); // SRS_VHOST_HTTP_HOOKS_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost->get("http_hooks"); if (!conf) { @@ -5783,7 +5786,7 @@ bool SrsConfig::get_vhost_is_edge(string vhost) bool SrsConfig::get_vhost_is_edge(SrsConfDirective* vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost; if (!conf) { @@ -5820,7 +5823,7 @@ SrsConfDirective* SrsConfig::get_vhost_edge_origin(string vhost) string SrsConfig::get_vhost_edge_protocol(string vhost) { - static string DEFAULT = "rtmp"; + SRS_CXX_STATIC string DEFAULT = "rtmp"; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5842,7 +5845,7 @@ string SrsConfig::get_vhost_edge_protocol(string vhost) bool SrsConfig::get_vhost_edge_follow_client(string vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5864,7 +5867,7 @@ bool SrsConfig::get_vhost_edge_follow_client(string vhost) bool SrsConfig::get_vhost_edge_token_traverse(string vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5886,7 +5889,7 @@ bool SrsConfig::get_vhost_edge_token_traverse(string vhost) string SrsConfig::get_vhost_edge_transform_vhost(string vhost) { - static string DEFAULT = "[vhost]"; + SRS_CXX_STATIC string DEFAULT = "[vhost]"; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5914,7 +5917,7 @@ bool SrsConfig::get_vhost_origin_cluster(string vhost) bool SrsConfig::get_vhost_origin_cluster(SrsConfDirective* vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost; if (!conf) { @@ -5961,7 +5964,7 @@ vector SrsConfig::get_vhost_coworkers(string vhost) bool SrsConfig::get_security_enabled(string vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -5973,7 +5976,7 @@ bool SrsConfig::get_security_enabled(string vhost) bool SrsConfig::get_security_enabled(SrsConfDirective* vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost->get("security"); if (!conf) { @@ -6015,7 +6018,7 @@ SrsConfDirective* SrsConfig::get_transcode(string vhost, string scope) bool SrsConfig::get_transcode_enabled(SrsConfDirective* conf) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; if (!conf) { return DEFAULT; @@ -6031,7 +6034,7 @@ bool SrsConfig::get_transcode_enabled(SrsConfDirective* conf) string SrsConfig::get_transcode_ffmpeg(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -6066,7 +6069,7 @@ vector SrsConfig::get_transcode_engines(SrsConfDirective* con bool SrsConfig::get_engine_enabled(SrsConfDirective* conf) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; if (!conf) { return DEFAULT; @@ -6119,7 +6122,7 @@ vector SrsConfig::get_engine_perfile(SrsConfDirective* conf) string SrsConfig::get_engine_iformat(SrsConfDirective* conf) { - static string DEFAULT = "flv"; + SRS_CXX_STATIC string DEFAULT = "flv"; if (!conf) { return DEFAULT; @@ -6163,7 +6166,7 @@ vector SrsConfig::get_engine_vfilter(SrsConfDirective* conf) string SrsConfig::get_engine_vcodec(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -6179,7 +6182,7 @@ string SrsConfig::get_engine_vcodec(SrsConfDirective* conf) int SrsConfig::get_engine_vbitrate(SrsConfDirective* conf) { - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; if (!conf) { return DEFAULT; @@ -6195,7 +6198,7 @@ int SrsConfig::get_engine_vbitrate(SrsConfDirective* conf) double SrsConfig::get_engine_vfps(SrsConfDirective* conf) { - static double DEFAULT = 0; + SRS_CXX_STATIC double DEFAULT = 0; if (!conf) { return DEFAULT; @@ -6211,7 +6214,7 @@ double SrsConfig::get_engine_vfps(SrsConfDirective* conf) int SrsConfig::get_engine_vwidth(SrsConfDirective* conf) { - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; if (!conf) { return DEFAULT; @@ -6227,7 +6230,7 @@ int SrsConfig::get_engine_vwidth(SrsConfDirective* conf) int SrsConfig::get_engine_vheight(SrsConfDirective* conf) { - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; if (!conf) { return DEFAULT; @@ -6243,7 +6246,7 @@ int SrsConfig::get_engine_vheight(SrsConfDirective* conf) int SrsConfig::get_engine_vthreads(SrsConfDirective* conf) { - static int DEFAULT = 1; + SRS_CXX_STATIC int DEFAULT = 1; if (!conf) { return DEFAULT; @@ -6259,7 +6262,7 @@ int SrsConfig::get_engine_vthreads(SrsConfDirective* conf) string SrsConfig::get_engine_vprofile(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -6275,7 +6278,7 @@ string SrsConfig::get_engine_vprofile(SrsConfDirective* conf) string SrsConfig::get_engine_vpreset(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -6319,7 +6322,7 @@ vector SrsConfig::get_engine_vparams(SrsConfDirective* conf) string SrsConfig::get_engine_acodec(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -6335,7 +6338,7 @@ string SrsConfig::get_engine_acodec(SrsConfDirective* conf) int SrsConfig::get_engine_abitrate(SrsConfDirective* conf) { - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; if (!conf) { return DEFAULT; @@ -6351,7 +6354,7 @@ int SrsConfig::get_engine_abitrate(SrsConfDirective* conf) int SrsConfig::get_engine_asample_rate(SrsConfDirective* conf) { - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; if (!conf) { return DEFAULT; @@ -6367,7 +6370,7 @@ int SrsConfig::get_engine_asample_rate(SrsConfDirective* conf) int SrsConfig::get_engine_achannels(SrsConfDirective* conf) { - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; if (!conf) { return DEFAULT; @@ -6411,7 +6414,7 @@ vector SrsConfig::get_engine_aparams(SrsConfDirective* conf) string SrsConfig::get_engine_oformat(SrsConfDirective* conf) { - static string DEFAULT = "flv"; + SRS_CXX_STATIC string DEFAULT = "flv"; if (!conf) { return DEFAULT; @@ -6427,7 +6430,7 @@ string SrsConfig::get_engine_oformat(SrsConfDirective* conf) string SrsConfig::get_engine_output(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -6453,7 +6456,7 @@ SrsConfDirective* SrsConfig::get_exec(string vhost) bool SrsConfig::get_exec_enabled(string vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -6465,7 +6468,7 @@ bool SrsConfig::get_exec_enabled(string vhost) bool SrsConfig::get_exec_enabled(SrsConfDirective* vhost) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost->get("exec"); if (!conf) { @@ -6531,7 +6534,7 @@ SrsConfDirective* SrsConfig::get_ingest_by_id(string vhost, string ingest_id) bool SrsConfig::get_ingest_enabled(SrsConfDirective* conf) { - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; if (!conf) { return DEFAULT; @@ -6547,7 +6550,7 @@ bool SrsConfig::get_ingest_enabled(SrsConfDirective* conf) string SrsConfig::get_ingest_ffmpeg(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -6563,7 +6566,7 @@ string SrsConfig::get_ingest_ffmpeg(SrsConfDirective* conf) string SrsConfig::get_ingest_input_type(SrsConfDirective* conf) { - static string DEFAULT = "file"; + SRS_CXX_STATIC string DEFAULT = "file"; if (!conf) { return DEFAULT; @@ -6584,7 +6587,7 @@ string SrsConfig::get_ingest_input_type(SrsConfDirective* conf) string SrsConfig::get_ingest_input_url(SrsConfDirective* conf) { - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; if (!conf) { return DEFAULT; @@ -6612,7 +6615,7 @@ bool SrsConfig::get_log_tank_file() return srs_getenv("srs.log_tank") != "console"; } - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; if (_srs_in_docker) { DEFAULT = false; @@ -6631,7 +6634,7 @@ string SrsConfig::get_log_level() SRS_OVERWRITE_BY_ENV_STRING("srs.srs_log_level"); // SRS_SRS_LOG_LEVEL SRS_OVERWRITE_BY_ENV_STRING("srs.log_level"); // SRS_LOG_LEVEL - static string DEFAULT = "trace"; + SRS_CXX_STATIC string DEFAULT = "trace"; SrsConfDirective* conf = root->get("srs_log_level"); if (!conf || conf->arg0().empty()) { @@ -6646,7 +6649,7 @@ string SrsConfig::get_log_level_v2() SRS_OVERWRITE_BY_ENV_STRING("srs.srs_log_level_v2"); // SRS_SRS_LOG_LEVEL_V2 SRS_OVERWRITE_BY_ENV_STRING("srs.log_level_v2"); // SRS_LOG_LEVEL_V2 - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("srs_log_level_v2"); if (!conf || conf->arg0().empty()) { @@ -6661,7 +6664,7 @@ string SrsConfig::get_log_file() SRS_OVERWRITE_BY_ENV_STRING("srs.srs_log_file"); // SRS_SRS_LOG_FILE SRS_OVERWRITE_BY_ENV_STRING("srs.log_file"); // SRS_LOG_FILE - static string DEFAULT = "./objs/srs.log"; + SRS_CXX_STATIC string DEFAULT = "./objs/srs.log"; SrsConfDirective* conf = root->get("srs_log_file"); if (!conf || conf->arg0().empty()) { @@ -6681,7 +6684,7 @@ string SrsConfig::get_ff_log_dir() { SRS_OVERWRITE_BY_ENV_STRING("srs.ff_log_dir"); // SRS_FF_LOG_DIR - static string DEFAULT = "./objs"; + SRS_CXX_STATIC string DEFAULT = "./objs"; SrsConfDirective* conf = root->get("ff_log_dir"); if (!conf || conf->arg0().empty()) { @@ -6695,7 +6698,7 @@ string SrsConfig::get_ff_log_level() { SRS_OVERWRITE_BY_ENV_STRING("srs.ff_log_level"); // SRS_FF_LOG_LEVEL - static string DEFAULT = "info"; + SRS_CXX_STATIC string DEFAULT = "info"; SrsConfDirective* conf = root->get("ff_log_level"); if (!conf || conf->arg0().empty()) { @@ -6715,7 +6718,7 @@ bool SrsConfig::get_dash_enabled(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.dash.enabled"); // SRS_VHOST_DASH_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -6729,7 +6732,7 @@ bool SrsConfig::get_dash_enabled(SrsConfDirective* vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.dash.enabled"); // SRS_VHOST_DASH_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost->get("dash"); if (!conf) { @@ -6748,7 +6751,7 @@ srs_utime_t SrsConfig::get_dash_fragment(string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.dash.dash_fragment"); // SRS_VHOST_DASH_DASH_FRAGMENT - static int DEFAULT = 10 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC int DEFAULT = 10 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_dash(vhost); if (!conf) { @@ -6767,7 +6770,7 @@ srs_utime_t SrsConfig::get_dash_update_period(string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.dash.dash_update_period"); // SRS_VHOST_DASH_DASH_UPDATE_PERIOD - static srs_utime_t DEFAULT = 5 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 5 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_dash(vhost); if (!conf) { @@ -6786,7 +6789,7 @@ srs_utime_t SrsConfig::get_dash_timeshift(string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.dash.dash_timeshift"); // SRS_VHOST_DASH_DASH_TIMESHIFT - static srs_utime_t DEFAULT = 300 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 300 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_dash(vhost); if (!conf) { @@ -6805,7 +6808,7 @@ string SrsConfig::get_dash_path(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.dash.dash_path"); // SRS_VHOST_DASH_DASH_PATH - static string DEFAULT = "./objs/nginx/html"; + SRS_CXX_STATIC string DEFAULT = "./objs/nginx/html"; SrsConfDirective* conf = get_dash(vhost); if (!conf) { @@ -6824,7 +6827,7 @@ string SrsConfig::get_dash_mpd_file(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.dash.dash_mpd_file"); // SRS_VHOST_DASH_DASH_MPD_FILE - static string DEFAULT = "[app]/[stream].mpd"; + SRS_CXX_STATIC string DEFAULT = "[app]/[stream].mpd"; SrsConfDirective* conf = get_dash(vhost); if (!conf) { @@ -6843,7 +6846,7 @@ int SrsConfig::get_dash_window_size(std::string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.dash.dash_window_size"); // SRS_VHOST_DASH_DASH_WINDOW_SIZE - static int DEFAULT = 5; + SRS_CXX_STATIC int DEFAULT = 5; SrsConfDirective* conf = get_dash(vhost); if (!conf) { @@ -6862,7 +6865,7 @@ bool SrsConfig::get_dash_cleanup(std::string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.dash.dash_cleanup"); // SRS_VHOST_DASH_DASH_CLEANUP - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_dash(vhost); if (!conf) { @@ -6881,7 +6884,7 @@ srs_utime_t SrsConfig::get_dash_dispose(std::string vhost) { SRS_OVERWRITE_BY_ENV_SECONDS("srs.vhost.dash.dash_dispose"); // SRS_VHOST_DASH_DASH_DISPOSE - static srs_utime_t DEFAULT = 120 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 120 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_dash(vhost); if (!conf) { @@ -6906,7 +6909,7 @@ bool SrsConfig::get_hls_enabled(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.hls.enabled"); // SRS_VHOST_HLS_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -6920,7 +6923,7 @@ bool SrsConfig::get_hls_enabled(SrsConfDirective* vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.hls.enabled"); // SRS_VHOST_HLS_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost->get("hls"); @@ -6940,7 +6943,7 @@ string SrsConfig::get_hls_entry_prefix(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_entry_prefix"); // SRS_VHOST_HLS_HLS_ENTRY_PREFIX - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -6959,7 +6962,7 @@ string SrsConfig::get_hls_path(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_path"); // SRS_VHOST_HLS_HLS_PATH - static string DEFAULT = "./objs/nginx/html"; + SRS_CXX_STATIC string DEFAULT = "./objs/nginx/html"; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -6978,7 +6981,7 @@ string SrsConfig::get_hls_m3u8_file(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_m3u8_file"); // SRS_VHOST_HLS_HLS_M3U8_FILE - static string DEFAULT = "[app]/[stream].m3u8"; + SRS_CXX_STATIC string DEFAULT = "[app]/[stream].m3u8"; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -6997,7 +7000,7 @@ string SrsConfig::get_hls_ts_file(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_ts_file"); // SRS_VHOST_HLS_HLS_TS_FILE - static string DEFAULT = "[app]/[stream]-[seq].ts"; + SRS_CXX_STATIC string DEFAULT = "[app]/[stream]-[seq].ts"; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7016,7 +7019,7 @@ bool SrsConfig::get_hls_ts_floor(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.hls.hls_ts_floor"); // SRS_VHOST_HLS_HLS_TS_FLOOR - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7035,7 +7038,7 @@ srs_utime_t SrsConfig::get_hls_fragment(string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.hls.hls_fragment"); // SRS_VHOST_HLS_HLS_FRAGMENT - static srs_utime_t DEFAULT = 10 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 10 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7054,7 +7057,7 @@ double SrsConfig::get_hls_td_ratio(string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT("srs.vhost.hls.hls_td_ratio"); // SRS_VHOST_HLS_HLS_TD_RATIO - static double DEFAULT = 1.0; + SRS_CXX_STATIC double DEFAULT = 1.0; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7073,7 +7076,7 @@ double SrsConfig::get_hls_aof_ratio(string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT("srs.vhost.hls.hls_aof_ratio"); // SRS_VHOST_HLS_HLS_AOF_RATIO - static double DEFAULT = 2.1; + SRS_CXX_STATIC double DEFAULT = 2.1; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7092,7 +7095,7 @@ srs_utime_t SrsConfig::get_hls_window(string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.hls.hls_window"); // SRS_VHOST_HLS_HLS_WINDOW - static srs_utime_t DEFAULT = (60 * SRS_UTIME_SECONDS); + SRS_CXX_STATIC srs_utime_t DEFAULT = (60 * SRS_UTIME_SECONDS); SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7112,7 +7115,7 @@ string SrsConfig::get_hls_on_error(string vhost) SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_on_error"); // SRS_VHOST_HLS_HLS_ON_ERROR // try to ignore the error. - static string DEFAULT = "continue"; + SRS_CXX_STATIC string DEFAULT = "continue"; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7131,7 +7134,7 @@ string SrsConfig::get_hls_acodec(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_acodec"); // SRS_VHOST_HLS_HLS_ACODEC - static string DEFAULT = "aac"; + SRS_CXX_STATIC string DEFAULT = "aac"; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7150,7 +7153,7 @@ string SrsConfig::get_hls_vcodec(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_vcodec"); // SRS_VHOST_HLS_HLS_VCODEC - static string DEFAULT = "h264"; + SRS_CXX_STATIC string DEFAULT = "h264"; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7169,7 +7172,7 @@ int SrsConfig::get_vhost_hls_nb_notify(string vhost) { SRS_OVERWRITE_BY_ENV_INT("srs.vhost.hls.hls_nb_notify"); // SRS_VHOST_HLS_HLS_NB_NOTIFY - static int DEFAULT = 64; + SRS_CXX_STATIC int DEFAULT = 64; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7188,7 +7191,7 @@ bool SrsConfig::get_vhost_hls_dts_directly(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.hls.hls_dts_directly"); // SRS_VHOST_HLS_HLS_DTS_DIRECTLY - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7207,7 +7210,7 @@ bool SrsConfig::get_hls_ctx_enabled(std::string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.hls.hls_ctx"); // SRS_VHOST_HLS_HLS_CTX - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7226,7 +7229,7 @@ bool SrsConfig::get_hls_ts_ctx_enabled(std::string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.hls.hls_ts_ctx"); // SRS_VHOST_HLS_HLS_TS_CTX - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7245,7 +7248,7 @@ bool SrsConfig::get_hls_cleanup(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.hls.hls_cleanup"); // SRS_VHOST_HLS_HLS_CLEANUP - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7264,7 +7267,7 @@ srs_utime_t SrsConfig::get_hls_dispose(string vhost) { SRS_OVERWRITE_BY_ENV_SECONDS("srs.vhost.hls.hls_dispose"); // SRS_VHOST_HLS_HLS_DISPOSE - static srs_utime_t DEFAULT = 120 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 120 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7283,7 +7286,7 @@ bool SrsConfig::get_hls_wait_keyframe(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.hls.hls_wait_keyframe"); // SRS_VHOST_HLS_HLS_WAIT_KEYFRAME - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7302,7 +7305,7 @@ bool SrsConfig::get_hls_keys(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.hls.hls_keys"); // SRS_VHOST_HLS_HLS_KEYS - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7321,7 +7324,7 @@ int SrsConfig::get_hls_fragments_per_key(string vhost) { SRS_OVERWRITE_BY_ENV_INT("srs.vhost.hls.hls_fragments_per_key"); // SRS_VHOST_HLS_HLS_FRAGMENTS_PER_KEY - static int DEFAULT = 5; + SRS_CXX_STATIC int DEFAULT = 5; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7340,7 +7343,7 @@ string SrsConfig::get_hls_key_file(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_key_file"); // SRS_VHOST_HLS_HLS_KEY_FILE - static string DEFAULT = "[app]/[stream]-[seq].key"; + SRS_CXX_STATIC string DEFAULT = "[app]/[stream]-[seq].key"; SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7360,7 +7363,7 @@ string SrsConfig::get_hls_key_file_path(std::string vhost) SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_key_file_path"); // SRS_VHOST_HLS_HLS_KEY_FILE_PATH //put the key in ts path defaultly. - static string DEFAULT = get_hls_path(vhost); + SRS_CXX_STATIC string DEFAULT = get_hls_path(vhost); SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7380,7 +7383,7 @@ string SrsConfig::get_hls_key_url(std::string vhost) SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hls.hls_key_url"); // SRS_VHOST_HLS_HLS_KEY_URL //put the key in ts path defaultly. - static string DEFAULT = get_hls_path(vhost); + SRS_CXX_STATIC string DEFAULT = get_hls_path(vhost); SrsConfDirective* conf = get_hls(vhost); if (!conf) { @@ -7410,7 +7413,7 @@ bool SrsConfig::get_hds_enabled(const string &vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.hds.enabled"); // SRS_VHOST_HDS_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -7424,7 +7427,7 @@ bool SrsConfig::get_hds_enabled(SrsConfDirective* vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.hds.enabled"); // SRS_VHOST_HDS_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost->get("hds"); if (!conf) { @@ -7443,7 +7446,7 @@ string SrsConfig::get_hds_path(const string &vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.hds.hds_path"); // SRS_VHOST_HDS_HDS_PATH - static string DEFAULT = "./objs/nginx/html"; + SRS_CXX_STATIC string DEFAULT = "./objs/nginx/html"; SrsConfDirective* conf = get_hds(vhost); if (!conf) { @@ -7462,7 +7465,7 @@ srs_utime_t SrsConfig::get_hds_fragment(const string &vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.hds.hds_fragment"); // SRS_VHOST_HDS_HDS_FRAGMENT - static srs_utime_t DEFAULT = (10 * SRS_UTIME_SECONDS); + SRS_CXX_STATIC srs_utime_t DEFAULT = (10 * SRS_UTIME_SECONDS); SrsConfDirective* conf = get_hds(vhost); if (!conf) { @@ -7481,7 +7484,7 @@ srs_utime_t SrsConfig::get_hds_window(const string &vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.hds.hds_window"); // SRS_VHOST_HDS_HDS_WINDOW - static srs_utime_t DEFAULT = (60 * SRS_UTIME_SECONDS); + SRS_CXX_STATIC srs_utime_t DEFAULT = (60 * SRS_UTIME_SECONDS); SrsConfDirective* conf = get_hds(vhost); if (!conf) { @@ -7510,7 +7513,7 @@ bool SrsConfig::get_dvr_enabled(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.dvr.enabled"); // SRS_VHOST_DVR_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -7524,7 +7527,7 @@ bool SrsConfig::get_dvr_enabled(SrsConfDirective* vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.dvr.enabled"); // SRS_VHOST_DVR_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost->get("dvr"); if (!conf) { @@ -7558,7 +7561,7 @@ string SrsConfig::get_dvr_path(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.dvr.dvr_path"); // SRS_VHOST_DVR_DVR_PATH - static string DEFAULT = "./objs/nginx/html/[app]/[stream].[timestamp].flv"; + SRS_CXX_STATIC string DEFAULT = "./objs/nginx/html/[app]/[stream].[timestamp].flv"; SrsConfDirective* conf = get_dvr(vhost); if (!conf) { @@ -7577,7 +7580,7 @@ string SrsConfig::get_dvr_plan(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.dvr.dvr_plan"); // SRS_VHOST_DVR_DVR_PLAN - static string DEFAULT = "session"; + SRS_CXX_STATIC string DEFAULT = "session"; SrsConfDirective* conf = get_dvr(vhost); if (!conf) { @@ -7596,7 +7599,7 @@ srs_utime_t SrsConfig::get_dvr_duration(string vhost) { SRS_OVERWRITE_BY_ENV_SECONDS("srs.vhost.dvr.dvr_duration"); // SRS_VHOST_DVR_DVR_DURATION - static srs_utime_t DEFAULT = 30 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 30 * SRS_UTIME_SECONDS; SrsConfDirective* conf = get_dvr(vhost); if (!conf) { @@ -7615,7 +7618,7 @@ bool SrsConfig::get_dvr_wait_keyframe(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.dvr.dvr_wait_keyframe"); // SRS_VHOST_DVR_DVR_WAIT_KEYFRAME - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_dvr(vhost); if (!conf) { @@ -7636,7 +7639,7 @@ int SrsConfig::get_dvr_time_jitter(string vhost) return srs_time_jitter_string2int(srs_getenv("srs.vhost.dvr.time_jitter")); } - static string DEFAULT = "full"; + SRS_CXX_STATIC string DEFAULT = "full"; SrsConfDirective* conf = get_dvr(vhost); @@ -7662,7 +7665,7 @@ bool SrsConfig::get_http_api_enabled(SrsConfDirective* conf) { SRS_OVERWRITE_BY_ENV_BOOL("srs.http_api.enabled"); // SRS_HTTP_API_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; if (!conf) { return DEFAULT; @@ -7680,7 +7683,7 @@ string SrsConfig::get_http_api_listen() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_api.listen"); // SRS_HTTP_API_LISTEN - static string DEFAULT = "1985"; + SRS_CXX_STATIC string DEFAULT = "1985"; SrsConfDirective* conf = root->get("http_api"); @@ -7700,7 +7703,7 @@ bool SrsConfig::get_http_api_crossdomain() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.http_api.crossdomain"); // SRS_HTTP_API_CROSSDOMAIN - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("http_api"); if (!conf) { @@ -7719,7 +7722,7 @@ bool SrsConfig::get_raw_api() { SRS_OVERWRITE_BY_ENV_BOOL("srs.http_api.raw_api.enabled"); // SRS_HTTP_API_RAW_API_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("http_api"); if (!conf) { @@ -7743,7 +7746,7 @@ bool SrsConfig::get_raw_api_allow_reload() { SRS_OVERWRITE_BY_ENV_BOOL("srs.http_api.raw_api.allow_reload"); // SRS_HTTP_API_RAW_API_ALLOW_RELOAD - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("http_api"); if (!conf) { @@ -7779,7 +7782,7 @@ bool SrsConfig::get_http_api_auth_enabled() { SRS_OVERWRITE_BY_ENV_BOOL("srs.http_api.auth.enabled"); // SRS_HTTP_API_AUTH_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("http_api"); if (!conf) { @@ -7803,7 +7806,7 @@ std::string SrsConfig::get_http_api_auth_username() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_api.auth.username"); // SRS_HTTP_API_AUTH_USERNAME - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("http_api"); if (!conf) { @@ -7827,7 +7830,7 @@ std::string SrsConfig::get_http_api_auth_password() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_api.auth.password"); // SRS_HTTP_API_AUTH_PASSWORD - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("http_api"); if (!conf) { @@ -7861,7 +7864,7 @@ bool SrsConfig::get_https_api_enabled() { SRS_OVERWRITE_BY_ENV_BOOL("srs.http_api.https.enabled"); // SRS_HTTP_API_HTTPS_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_https_api(); if (!conf) { @@ -7904,7 +7907,7 @@ string SrsConfig::get_https_api_ssl_key() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_api.https.key"); // SRS_HTTP_API_HTTPS_KEY - static string DEFAULT = "./conf/server.key"; + SRS_CXX_STATIC string DEFAULT = "./conf/server.key"; SrsConfDirective* conf = get_https_api(); if (!conf) { @@ -7923,7 +7926,7 @@ string SrsConfig::get_https_api_ssl_cert() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_api.https.cert"); // SRS_HTTP_API_HTTPS_CERT - static string DEFAULT = "./conf/server.crt"; + SRS_CXX_STATIC string DEFAULT = "./conf/server.crt"; SrsConfDirective* conf = get_https_api(); if (!conf) { @@ -7942,7 +7945,7 @@ bool SrsConfig::get_srt_enabled() { SRS_OVERWRITE_BY_ENV_BOOL("srs.srt_server.enabled"); // SRS_SRT_SERVER_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { @@ -7961,7 +7964,7 @@ unsigned short SrsConfig::get_srt_listen_port() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.listen"); // SRS_SRT_SERVER_LISTEN - static unsigned short DEFAULT = 10080; + SRS_CXX_STATIC unsigned short DEFAULT = 10080; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -7978,7 +7981,7 @@ int64_t SrsConfig::get_srto_maxbw() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.maxbw"); // SRS_SRT_SERVER_MAXBW - static int64_t DEFAULT = -1; + SRS_CXX_STATIC int64_t DEFAULT = -1; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -7995,7 +7998,7 @@ int SrsConfig::get_srto_mss() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.mss"); // SRS_SRT_SERVER_MSS - static int DEFAULT = 1500; + SRS_CXX_STATIC int DEFAULT = 1500; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8012,7 +8015,7 @@ bool SrsConfig::get_srto_tsbpdmode() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.srt_server.tsbpdmode"); // SRS_SRT_SERVER_TSBPDMODE - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8029,7 +8032,7 @@ int SrsConfig::get_srto_latency() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.latency"); // SRS_SRT_SERVER_LATENCY - static int DEFAULT = 120; + SRS_CXX_STATIC int DEFAULT = 120; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8046,7 +8049,7 @@ int SrsConfig::get_srto_recv_latency() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.recvlatency"); // SRS_SRT_SERVER_RECVLATENCY - static int DEFAULT = 120; + SRS_CXX_STATIC int DEFAULT = 120; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8063,7 +8066,7 @@ int SrsConfig::get_srto_peer_latency() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.peerlatency"); // SRS_SRT_SERVER_PEERLATENCY - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8080,7 +8083,7 @@ bool SrsConfig::get_srt_sei_filter() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.srt_server.sei_filter"); // SRS_SRT_SERVER_SEI_FILTER - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8097,7 +8100,7 @@ bool SrsConfig::get_srto_tlpktdrop() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.srt_server.tlpktdrop"); // SRS_SRT_SERVER_TLPKTDROP - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* srt_server_conf = root->get("srt_server"); if (!srt_server_conf) { return DEFAULT; @@ -8114,7 +8117,7 @@ srs_utime_t SrsConfig::get_srto_conntimeout() { SRS_OVERWRITE_BY_ENV_MILLISECONDS("srs.srt_server.connect_timeout"); // SRS_SRT_SERVER_CONNECT_TIMEOUT - static srs_utime_t DEFAULT = 3 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 3 * SRS_UTIME_SECONDS; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8131,7 +8134,7 @@ srs_utime_t SrsConfig::get_srto_peeridletimeout() { SRS_OVERWRITE_BY_ENV_MILLISECONDS("srs.srt_server.peer_idle_timeout"); // SRS_SRT_SERVER_PEER_IDLE_TIMEOUT - static srs_utime_t DEFAULT = 10 * SRS_UTIME_SECONDS; + SRS_CXX_STATIC srs_utime_t DEFAULT = 10 * SRS_UTIME_SECONDS; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8148,7 +8151,7 @@ int SrsConfig::get_srto_sendbuf() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.sendbuf"); // SRS_SRT_SERVER_SENDBUF - static int DEFAULT = 8192 * (1500-28); + SRS_CXX_STATIC int DEFAULT = 8192 * (1500-28); SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8165,7 +8168,7 @@ int SrsConfig::get_srto_recvbuf() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.recvbuf"); // SRS_SRT_SERVER_RECVBUF - static int DEFAULT = 8192 * (1500-28); + SRS_CXX_STATIC int DEFAULT = 8192 * (1500-28); SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8182,7 +8185,7 @@ int SrsConfig::get_srto_payloadsize() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.payloadsize"); // SRS_SRT_SERVER_PAYLOADSIZE - static int DEFAULT = 1316; + SRS_CXX_STATIC int DEFAULT = 1316; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8199,7 +8202,7 @@ string SrsConfig::get_srto_passphrase() { SRS_OVERWRITE_BY_ENV_STRING("srs.srt_server.passphrase"); // SRS_SRT_SERVER_PASSPHRASE - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8216,7 +8219,7 @@ int SrsConfig::get_srto_pbkeylen() { SRS_OVERWRITE_BY_ENV_INT("srs.srt_server.pbkeylen"); // SRS_SRT_SERVER_PBKEYLEN - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8233,7 +8236,7 @@ string SrsConfig::get_default_app_name() { SRS_OVERWRITE_BY_ENV_STRING("srs.srt_server.default_app"); // SRS_SRT_SERVER_DEFAULT_APP - static string DEFAULT = "live"; + SRS_CXX_STATIC string DEFAULT = "live"; SrsConfDirective* conf = root->get("srt_server"); if (!conf) { return DEFAULT; @@ -8256,7 +8259,7 @@ bool SrsConfig::get_srt_enabled(std::string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.srt.enabled"); // SRS_VHOST_SRT_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_srt(vhost); @@ -8277,7 +8280,7 @@ bool SrsConfig::get_srt_to_rtmp(std::string vhost) SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.srt.srt_to_rtmp"); // SRS_VHOST_SRT_SRT_TO_RTMP SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.srt.to_rtmp"); // SRS_VHOST_SRT_TO_RTMP - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_srt(vhost); if (!conf) { @@ -8302,7 +8305,7 @@ bool SrsConfig::get_http_stream_enabled(SrsConfDirective* conf) { SRS_OVERWRITE_BY_ENV_BOOL("srs.http_server.enabled"); // SRS_HTTP_SERVER_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; if (!conf) { return DEFAULT; @@ -8320,7 +8323,7 @@ string SrsConfig::get_http_stream_listen() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_server.listen"); // SRS_HTTP_SERVER_LISTEN - static string DEFAULT = "8080"; + SRS_CXX_STATIC string DEFAULT = "8080"; SrsConfDirective* conf = root->get("http_server"); if (!conf) { @@ -8339,7 +8342,7 @@ string SrsConfig::get_http_stream_dir() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_server.dir"); // SRS_HTTP_SERVER_DIR - static string DEFAULT = "./objs/nginx/html"; + SRS_CXX_STATIC string DEFAULT = "./objs/nginx/html"; SrsConfDirective* conf = root->get("http_server"); if (!conf) { @@ -8358,7 +8361,7 @@ bool SrsConfig::get_http_stream_crossdomain() { SRS_OVERWRITE_BY_ENV_BOOL2("srs.http_server.crossdomain"); // SRS_HTTP_SERVER_CROSSDOMAIN - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = root->get("http_server"); if (!conf) { @@ -8387,7 +8390,7 @@ bool SrsConfig::get_https_stream_enabled() { SRS_OVERWRITE_BY_ENV_BOOL("srs.http_server.https.enabled"); // SRS_HTTP_SERVER_HTTPS_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_https_stream(); if (!conf) { @@ -8406,7 +8409,7 @@ string SrsConfig::get_https_stream_listen() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_server.https.listen"); // SRS_HTTP_SERVER_HTTPS_LISTEN - static string DEFAULT = "8088"; + SRS_CXX_STATIC string DEFAULT = "8088"; SrsConfDirective* conf = get_https_stream(); if (!conf) { @@ -8425,7 +8428,7 @@ string SrsConfig::get_https_stream_ssl_key() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_server.https.key"); // SRS_HTTP_SERVER_HTTPS_KEY - static string DEFAULT = "./conf/server.key"; + SRS_CXX_STATIC string DEFAULT = "./conf/server.key"; SrsConfDirective* conf = get_https_stream(); if (!conf) { @@ -8444,7 +8447,7 @@ string SrsConfig::get_https_stream_ssl_cert() { SRS_OVERWRITE_BY_ENV_STRING("srs.http_server.https.cert"); // SRS_HTTP_SERVER_HTTPS_CERT - static string DEFAULT = "./conf/server.crt"; + SRS_CXX_STATIC string DEFAULT = "./conf/server.crt"; SrsConfDirective* conf = get_https_stream(); if (!conf) { @@ -8463,7 +8466,7 @@ bool SrsConfig::get_vhost_http_enabled(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.http_static.enabled"); // SRS_VHOST_HTTP_STATIC_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8487,7 +8490,7 @@ string SrsConfig::get_vhost_http_mount(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.http_static.mount"); // SRS_VHOST_HTTP_STATIC_MOUNT - static string DEFAULT = "[vhost]/"; + SRS_CXX_STATIC string DEFAULT = "[vhost]/"; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8511,7 +8514,7 @@ string SrsConfig::get_vhost_http_dir(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.http_static.dir"); // SRS_VHOST_HTTP_STATIC_DIR - static string DEFAULT = "./objs/nginx/html"; + SRS_CXX_STATIC string DEFAULT = "./objs/nginx/html"; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8535,7 +8538,7 @@ bool SrsConfig::get_vhost_http_remux_enabled(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.http_remux.enabled"); // SRS_VHOST_HTTP_REMUX_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8549,7 +8552,7 @@ bool SrsConfig::get_vhost_http_remux_enabled(SrsConfDirective* vhost) { SRS_OVERWRITE_BY_ENV_BOOL("srs.vhost.http_remux.enabled"); // SRS_VHOST_HTTP_REMUX_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = vhost->get("http_remux"); if (!conf) { @@ -8568,7 +8571,7 @@ srs_utime_t SrsConfig::get_vhost_http_remux_fast_cache(string vhost) { SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.http_remux.fast_cache"); // SRS_VHOST_HTTP_REMUX_FAST_CACHE - static srs_utime_t DEFAULT = 0; + SRS_CXX_STATIC srs_utime_t DEFAULT = 0; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8592,7 +8595,7 @@ bool SrsConfig::get_vhost_http_remux_drop_if_not_match(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.http_remux.drop_if_not_match"); // SRS_VHOST_HTTP_REMUX_DROP_IF_NOT_MATCH - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8616,7 +8619,7 @@ bool SrsConfig::get_vhost_http_remux_has_audio(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.http_remux.has_audio"); // SRS_VHOST_HTTP_REMUX_HAS_AUDIO - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8640,7 +8643,7 @@ bool SrsConfig::get_vhost_http_remux_has_video(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.http_remux.has_video"); // SRS_VHOST_HTTP_REMUX_HAS_VIDEO - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8664,7 +8667,7 @@ bool SrsConfig::get_vhost_http_remux_guess_has_av(string vhost) { SRS_OVERWRITE_BY_ENV_BOOL2("srs.vhost.http_remux.guess_has_av"); // SRS_VHOST_HTTP_REMUX_GUESS_HAS_AV - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8688,7 +8691,7 @@ string SrsConfig::get_vhost_http_remux_mount(string vhost) { SRS_OVERWRITE_BY_ENV_STRING("srs.vhost.http_remux.mount"); // SRS_VHOST_HTTP_REMUX_MOUNT - static string DEFAULT = "[vhost]/[app]/[stream].flv"; + SRS_CXX_STATIC string DEFAULT = "[vhost]/[app]/[stream].flv"; SrsConfDirective* conf = get_vhost(vhost); if (!conf) { @@ -8717,7 +8720,7 @@ bool SrsConfig::get_heartbeat_enabled() { SRS_OVERWRITE_BY_ENV_BOOL("srs.heartbeat.enabled"); // SRS_HEARTBEAT_ENABLED - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_heartbeart(); if (!conf) { @@ -8736,7 +8739,7 @@ srs_utime_t SrsConfig::get_heartbeat_interval() { SRS_OVERWRITE_BY_ENV_SECONDS("srs.heartbeat.interval"); // SRS_HEARTBEAT_INTERVAL - static srs_utime_t DEFAULT = (srs_utime_t)(10 * SRS_UTIME_SECONDS); + SRS_CXX_STATIC srs_utime_t DEFAULT = (srs_utime_t)(10 * SRS_UTIME_SECONDS); SrsConfDirective* conf = get_heartbeart(); if (!conf) { @@ -8755,7 +8758,7 @@ string SrsConfig::get_heartbeat_url() { SRS_OVERWRITE_BY_ENV_STRING("srs.heartbeat.url"); // SRS_HEARTBEAT_URL - static string DEFAULT = "http://" SRS_CONSTS_LOCALHOST ":8085/api/v1/servers"; + SRS_CXX_STATIC string DEFAULT = "http://" SRS_CONSTS_LOCALHOST ":8085/api/v1/servers"; SrsConfDirective* conf = get_heartbeart(); if (!conf) { @@ -8774,7 +8777,7 @@ string SrsConfig::get_heartbeat_device_id() { SRS_OVERWRITE_BY_ENV_STRING("srs.heartbeat.device_id"); // SRS_HEARTBEAT_DEVICE_ID - static string DEFAULT = ""; + SRS_CXX_STATIC string DEFAULT = ""; SrsConfDirective* conf = get_heartbeart(); if (!conf) { @@ -8793,7 +8796,7 @@ bool SrsConfig::get_heartbeat_summaries() { SRS_OVERWRITE_BY_ENV_BOOL("srs.heartbeat.summaries"); // SRS_HEARTBEAT_SUMMARIES - static bool DEFAULT = false; + SRS_CXX_STATIC bool DEFAULT = false; SrsConfDirective* conf = get_heartbeart(); if (!conf) { @@ -8815,7 +8818,7 @@ SrsConfDirective* SrsConfig::get_stats() bool SrsConfig::get_stats_enabled() { - static bool DEFAULT = true; + SRS_CXX_STATIC bool DEFAULT = true; SrsConfDirective* conf = get_stats(); if (!conf) { @@ -8832,7 +8835,7 @@ bool SrsConfig::get_stats_enabled() int SrsConfig::get_stats_network() { - static int DEFAULT = 0; + SRS_CXX_STATIC int DEFAULT = 0; SrsConfDirective* conf = get_stats(); if (!conf) {