From 330100769fb0c83e0ef86c122750969eb150dbbc Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 22 Dec 2018 19:48:55 +0800 Subject: [PATCH 1/9] Always enable SRS_TRANSCODE --- trunk/auto/auto_headers.sh | 6 ------ trunk/auto/options.sh | 17 +++-------------- trunk/src/app/srs_app_config.cpp | 5 ----- trunk/src/app/srs_app_encoder.cpp | 5 ----- trunk/src/app/srs_app_encoder.hpp | 4 ---- trunk/src/app/srs_app_http_api.cpp | 4 ---- trunk/src/app/srs_app_source.cpp | 11 ----------- trunk/src/app/srs_app_source.hpp | 4 ---- trunk/src/main/srs_main_server.cpp | 2 +- 9 files changed, 4 insertions(+), 54 deletions(-) diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index 2b3eb7f41..fc4f21d78 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -142,12 +142,6 @@ else srs_undefine_macro "SRS_AUTO_FFMPEG_STUB" $SRS_AUTO_HEADERS_H fi -if [ $SRS_TRANSCODE = YES ]; then - srs_define_macro "SRS_AUTO_TRANSCODE" $SRS_AUTO_HEADERS_H -else - srs_undefine_macro "SRS_AUTO_TRANSCODE" $SRS_AUTO_HEADERS_H -fi - if [ $SRS_INGEST = YES ]; then srs_define_macro "SRS_AUTO_INGEST" $SRS_AUTO_HEADERS_H else diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 98928ebf6..cb44649e5 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -19,7 +19,6 @@ SRS_HDS=RESERVED SRS_NGINX=RESERVED SRS_SSL=RESERVED SRS_FFMPEG_TOOL=RESERVED -SRS_TRANSCODE=RESERVED SRS_INGEST=RESERVED SRS_STAT=RESERVED SRS_STREAM_CASTER=RESERVED @@ -41,6 +40,7 @@ SRS_GPERF_CP=RESERVED SRS_GPROF=RESERVED # # Always enable the bellow features. +SRS_TRANSCODE=YES SRS_HTTP_CALLBACK=YES SRS_HTTP_SERVER=YES SRS_HTTP_API=YES @@ -391,7 +391,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=NO SRS_FFMPEG_TOOL=NO - SRS_TRANSCODE=NO SRS_INGEST=NO SRS_STAT=NO SRS_STREAM_CASTER=NO @@ -414,7 +413,6 @@ function apply_user_presets() { SRS_NGINX=YES SRS_SSL=YES SRS_FFMPEG_TOOL=YES - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=YES @@ -437,7 +435,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=NO SRS_FFMPEG_TOOL=NO - SRS_TRANSCODE=NO SRS_INGEST=NO SRS_STAT=NO SRS_STREAM_CASTER=NO @@ -460,7 +457,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=NO - SRS_TRANSCODE=NO SRS_INGEST=NO SRS_STAT=NO SRS_STREAM_CASTER=NO @@ -483,7 +479,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=NO - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=YES @@ -507,7 +502,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=NO - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=YES @@ -530,7 +524,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=NO - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=YES @@ -553,7 +546,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=NO - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=YES @@ -579,7 +571,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=YES - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=YES @@ -602,7 +593,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=NO - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=YES @@ -625,7 +615,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=YES - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=YES @@ -648,7 +637,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=NO - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=YES @@ -671,7 +659,6 @@ function apply_user_presets() { SRS_NGINX=NO SRS_SSL=YES SRS_FFMPEG_TOOL=YES - SRS_TRANSCODE=YES SRS_INGEST=YES SRS_STAT=YES SRS_STREAM_CASTER=NO @@ -707,6 +694,7 @@ function apply_user_detail_options() { # Always enable HTTP utilies. if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable HTTP utilies.${BLACK}"; fi + if [ $SRS_TRANSCODE = NO ]; then SRS_TRANSCODE=YES; echo -e "${YELLOW}[WARN] Always enable Transcode.${BLACK}"; fi if [ $SRS_HTTP_CALLBACK = NO ]; then SRS_HTTP_CALLBACK=YES; echo -e "${YELLOW}[WARN] Always enable HTTP callback.${BLACK}"; fi if [ $SRS_HTTP_SERVER = NO ]; then SRS_HTTP_SERVER=YES; echo -e "${YELLOW}[WARN] Always enable HTTP server.${BLACK}"; fi if [ $SRS_HTTP_API = NO ]; then SRS_HTTP_API=YES; echo -e "${YELLOW}[WARN] Always enable HTTP API.${BLACK}"; fi @@ -732,6 +720,7 @@ function apply_user_detail_options() { SRS_SSL=NO SRS_FFMPEG_TOOL=NO SRS_TRANSCODE=NO + SRS_HTTP_CALLBACK=NO SRS_INGEST=NO SRS_STAT=NO SRS_STREAM_CASTER=NO diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 32abb188a..7a5b5a4fd 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -3895,11 +3895,6 @@ srs_error_t SrsConfig::check_normal_config() if (get_hls_enabled(vhost->arg0())) { srs_warn("can't enable vhost.hls of %s", vhost->arg0().c_str()); } -#ifndef SRS_AUTO_TRANSCODE - if (get_transcode_enabled(get_transcode(vhost->arg0(), ""))) { - srs_warn("can't enable vhost.transcode of %s", vhost->arg0().c_str()); - } -#endif #ifndef SRS_AUTO_INGEST vector ingesters = get_ingesters(vhost->arg0()); for (int j = 0; j < (int)ingesters.size(); j++) { diff --git a/trunk/src/app/srs_app_encoder.cpp b/trunk/src/app/srs_app_encoder.cpp index 00370f93b..2a0d101ce 100644 --- a/trunk/src/app/srs_app_encoder.cpp +++ b/trunk/src/app/srs_app_encoder.cpp @@ -34,8 +34,6 @@ using namespace std; #include #include -#ifdef SRS_AUTO_TRANSCODE - // for encoder to detect the dead loop static std::vector _transcoded_url; @@ -334,6 +332,3 @@ void SrsEncoder::show_encode_log_message() } } -#endif - - diff --git a/trunk/src/app/srs_app_encoder.hpp b/trunk/src/app/srs_app_encoder.hpp index b8ebede58..9995e93f2 100644 --- a/trunk/src/app/srs_app_encoder.hpp +++ b/trunk/src/app/srs_app_encoder.hpp @@ -26,8 +26,6 @@ #include -#ifdef SRS_AUTO_TRANSCODE - #include #include @@ -72,5 +70,3 @@ private: #endif -#endif - diff --git a/trunk/src/app/srs_app_http_api.cpp b/trunk/src/app/srs_app_http_api.cpp index 9f0389826..a86c5802c 100644 --- a/trunk/src/app/srs_app_http_api.cpp +++ b/trunk/src/app/srs_app_http_api.cpp @@ -603,11 +603,7 @@ srs_error_t SrsGoApiFeatures::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess features->set("api", SrsJsonAny::boolean(true)); features->set("httpd", SrsJsonAny::boolean(true)); features->set("dvr", SrsJsonAny::boolean(true)); -#ifdef SRS_AUTO_TRANSCODE features->set("transcode", SrsJsonAny::boolean(true)); -#else - features->set("transcode", SrsJsonAny::boolean(false)); -#endif #ifdef SRS_AUTO_INGEST features->set("ingest", SrsJsonAny::boolean(true)); #else diff --git a/trunk/src/app/srs_app_source.cpp b/trunk/src/app/srs_app_source.cpp index fb47c6d61..c81696875 100755 --- a/trunk/src/app/srs_app_source.cpp +++ b/trunk/src/app/srs_app_source.cpp @@ -824,9 +824,7 @@ SrsOriginHub::SrsOriginHub() hls = new SrsHls(); dash = new SrsDash(); dvr = new SrsDvr(); -#ifdef SRS_AUTO_TRANSCODE encoder = new SrsEncoder(); -#endif #ifdef SRS_AUTO_HDS hds = new SrsHds(); #endif @@ -854,9 +852,7 @@ SrsOriginHub::~SrsOriginHub() srs_freep(hls); srs_freep(dash); srs_freep(dvr); -#ifdef SRS_AUTO_TRANSCODE srs_freep(encoder); -#endif #ifdef SRS_AUTO_HDS srs_freep(hds); #endif @@ -1116,11 +1112,9 @@ srs_error_t SrsOriginHub::on_publish() } // TODO: FIXME: use initialize to set req. -#ifdef SRS_AUTO_TRANSCODE if ((err = encoder->on_publish(req)) != srs_success) { return srs_error_wrap(err, "encoder publish"); } -#endif if ((err = hls->on_publish()) != srs_success) { return srs_error_wrap(err, "hls publish"); @@ -1158,10 +1152,7 @@ void SrsOriginHub::on_unpublish() // destroy all forwarders destroy_forwarders(); -#ifdef SRS_AUTO_TRANSCODE encoder->on_unpublish(); -#endif - hls->on_unpublish(); dash->on_unpublish(); dvr->on_unpublish(); @@ -1419,7 +1410,6 @@ srs_error_t SrsOriginHub::on_reload_vhost_transcode(string vhost) // TODO: FIXME: maybe should ignore when publish already stopped? -#ifdef SRS_AUTO_TRANSCODE encoder->on_unpublish(); // Don't start transcode when source is not active. @@ -1431,7 +1421,6 @@ srs_error_t SrsOriginHub::on_reload_vhost_transcode(string vhost) return srs_error_wrap(err, "start encoder failed"); } srs_trace("vhost %s transcode reload success", vhost.c_str()); -#endif return err; } diff --git a/trunk/src/app/srs_app_source.hpp b/trunk/src/app/srs_app_source.hpp index 9fd8dcea8..e19105d01 100644 --- a/trunk/src/app/srs_app_source.hpp +++ b/trunk/src/app/srs_app_source.hpp @@ -55,9 +55,7 @@ class SrsMessageHeader; class SrsHls; class SrsDvr; class SrsDash; -#ifdef SRS_AUTO_TRANSCODE class SrsEncoder; -#endif class SrsBuffer; #ifdef SRS_AUTO_HDS class SrsHds; @@ -428,9 +426,7 @@ private: // dvr handler. SrsDvr* dvr; // transcoding handler. -#ifdef SRS_AUTO_TRANSCODE SrsEncoder* encoder; -#endif #ifdef SRS_AUTO_HDS // adobe hds(http dynamic streaming). SrsHds *hds; diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index ca9b5dd43..2f03198be 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -226,7 +226,7 @@ void show_macro_features() ss << ", hp:" << srs_bool2switch(true); ss << ", dvr:" << srs_bool2switch(SRS_AUTO_DVR_BOOL); // trans(transcode) - ss << ", trans:" << srs_bool2switch(SRS_AUTO_TRANSCODE_BOOL); + ss << ", trans:" << srs_bool2switch(true); // inge(ingest) ss << ", inge:" << srs_bool2switch(SRS_AUTO_INGEST_BOOL); ss << ", kafka:" << srs_bool2switch(SRS_AUTO_KAFKA_BOOL); From f003ba9a29aaf9a70eaa85a5e6a76a57e2e9f8e3 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 22 Dec 2018 19:50:57 +0800 Subject: [PATCH 2/9] Always enable SRS_DVR --- trunk/auto/auto_headers.sh | 6 ------ trunk/src/main/srs_main_server.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index fc4f21d78..e13855a4f 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -97,12 +97,6 @@ else srs_undefine_macro "SRS_AUTO_NGINX" $SRS_AUTO_HEADERS_H fi -if [ $SRS_DVR = YES ]; then - srs_define_macro "SRS_AUTO_DVR" $SRS_AUTO_HEADERS_H -else - srs_undefine_macro "SRS_AUTO_DVR" $SRS_AUTO_HEADERS_H -fi - if [ $SRS_HLS = YES ]; then srs_define_macro "SRS_AUTO_HLS" $SRS_AUTO_HEADERS_H else diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index 2f03198be..f4c4c69b3 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -224,7 +224,7 @@ void show_macro_features() ss << ", hs:" << srs_bool2switch(true); // hp(http parser) ss << ", hp:" << srs_bool2switch(true); - ss << ", dvr:" << srs_bool2switch(SRS_AUTO_DVR_BOOL); + ss << ", dvr:" << srs_bool2switch(true); // trans(transcode) ss << ", trans:" << srs_bool2switch(true); // inge(ingest) From 71f1ccbf9040d0474f679db540bf55ac4ebe30e6 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 22 Dec 2018 19:54:10 +0800 Subject: [PATCH 3/9] Always enable SRS_HLS --- trunk/auto/auto_headers.sh | 6 ------ trunk/src/main/srs_main_server.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index e13855a4f..51cf6cebe 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -97,12 +97,6 @@ else srs_undefine_macro "SRS_AUTO_NGINX" $SRS_AUTO_HEADERS_H fi -if [ $SRS_HLS = YES ]; then - srs_define_macro "SRS_AUTO_HLS" $SRS_AUTO_HEADERS_H -else - srs_undefine_macro "SRS_AUTO_HLS" $SRS_AUTO_HEADERS_H -fi - if [ $SRS_HDS = YES ]; then srs_define_macro "SRS_AUTO_HDS" $SRS_AUTO_HEADERS_H else diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index f4c4c69b3..933a5752e 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -214,7 +214,7 @@ void show_macro_features() // rch(rtmp complex handshake) ss << ", rch:" << srs_bool2switch(SRS_AUTO_SSL_BOOL); ss << ", dash:" << "on"; - ss << ", hls:" << srs_bool2switch(SRS_AUTO_HLS_BOOL); + ss << ", hls:" << srs_bool2switch(true); ss << ", hds:" << srs_bool2switch(SRS_AUTO_HDS_BOOL); // hc(http callback) ss << ", hc:" << srs_bool2switch(true); From 8e294709b0cec4494c9212a1e4957d1ba45015e1 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 22 Dec 2018 19:58:36 +0800 Subject: [PATCH 4/9] Always enable SRS_STAT --- trunk/auto/auto_headers.sh | 7 ------- trunk/auto/options.sh | 16 ++-------------- trunk/src/app/srs_app_http_api.cpp | 4 ---- trunk/src/app/srs_app_server.cpp | 4 ---- trunk/src/main/srs_main_server.cpp | 2 +- 5 files changed, 3 insertions(+), 30 deletions(-) diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index 51cf6cebe..adfe0251c 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -136,13 +136,6 @@ else srs_undefine_macro "SRS_AUTO_INGEST" $SRS_AUTO_HEADERS_H fi -# for statistic. -if [ $SRS_STAT = YES ]; then - srs_define_macro "SRS_AUTO_STAT" $SRS_AUTO_HEADERS_H -else - srs_undefine_macro "SRS_AUTO_STAT" $SRS_AUTO_HEADERS_H -fi - if [ $SRS_GPERF = YES ]; then srs_define_macro "SRS_AUTO_GPERF" $SRS_AUTO_HEADERS_H else diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index cb44649e5..42742a033 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -20,7 +20,6 @@ SRS_NGINX=RESERVED SRS_SSL=RESERVED SRS_FFMPEG_TOOL=RESERVED SRS_INGEST=RESERVED -SRS_STAT=RESERVED SRS_STREAM_CASTER=RESERVED SRS_KAFKA=RESERVED SRS_LIBRTMP=RESERVED @@ -40,6 +39,7 @@ SRS_GPERF_CP=RESERVED SRS_GPROF=RESERVED # # Always enable the bellow features. +SRS_STAT=YES SRS_TRANSCODE=YES SRS_HTTP_CALLBACK=YES SRS_HTTP_SERVER=YES @@ -392,7 +392,6 @@ function apply_user_presets() { SRS_SSL=NO SRS_FFMPEG_TOOL=NO SRS_INGEST=NO - SRS_STAT=NO SRS_STREAM_CASTER=NO SRS_KAFKA=NO SRS_LIBRTMP=NO @@ -414,7 +413,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=YES SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES @@ -436,7 +434,6 @@ function apply_user_presets() { SRS_SSL=NO SRS_FFMPEG_TOOL=NO SRS_INGEST=NO - SRS_STAT=NO SRS_STREAM_CASTER=NO SRS_KAFKA=NO SRS_LIBRTMP=NO @@ -458,7 +455,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=NO - SRS_STAT=NO SRS_STREAM_CASTER=NO SRS_KAFKA=NO SRS_LIBRTMP=NO @@ -480,7 +476,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES @@ -503,7 +498,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES @@ -525,7 +519,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES @@ -547,7 +540,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES @@ -572,7 +564,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=YES SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES @@ -594,7 +585,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=NO @@ -616,7 +606,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=YES SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES @@ -638,7 +627,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES @@ -660,7 +648,6 @@ function apply_user_presets() { SRS_SSL=YES SRS_FFMPEG_TOOL=YES SRS_INGEST=YES - SRS_STAT=YES SRS_STREAM_CASTER=NO SRS_KAFKA=YES SRS_LIBRTMP=YES @@ -694,6 +681,7 @@ function apply_user_detail_options() { # Always enable HTTP utilies. if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable HTTP utilies.${BLACK}"; fi + if [ $SRS_STAT = NO ]; then SRS_STAT=YES; echo -e "${YELLOW}[WARN] Always enable Statistic.${BLACK}"; fi if [ $SRS_TRANSCODE = NO ]; then SRS_TRANSCODE=YES; echo -e "${YELLOW}[WARN] Always enable Transcode.${BLACK}"; fi if [ $SRS_HTTP_CALLBACK = NO ]; then SRS_HTTP_CALLBACK=YES; echo -e "${YELLOW}[WARN] Always enable HTTP callback.${BLACK}"; fi if [ $SRS_HTTP_SERVER = NO ]; then SRS_HTTP_SERVER=YES; echo -e "${YELLOW}[WARN] Always enable HTTP server.${BLACK}"; fi diff --git a/trunk/src/app/srs_app_http_api.cpp b/trunk/src/app/srs_app_http_api.cpp index a86c5802c..7339b25db 100644 --- a/trunk/src/app/srs_app_http_api.cpp +++ b/trunk/src/app/srs_app_http_api.cpp @@ -609,11 +609,7 @@ srs_error_t SrsGoApiFeatures::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess #else features->set("ingest", SrsJsonAny::boolean(false)); #endif -#ifdef SRS_AUTO_STAT features->set("stat", SrsJsonAny::boolean(true)); -#else - features->set("stat", SrsJsonAny::boolean(false)); -#endif #ifdef SRS_AUTO_NGINX features->set("nginx", SrsJsonAny::boolean(true)); #else diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 1f0a25d91..05b9e7208 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -903,7 +903,6 @@ srs_error_t SrsServer::do_cycle() // find the max loop int max = srs_max(0, SRS_SYS_TIME_RESOLUTION_MS_TIMES); -#ifdef SRS_AUTO_STAT max = srs_max(max, SRS_SYS_RUSAGE_RESOLUTION_TIMES); max = srs_max(max, SRS_SYS_CPU_STAT_RESOLUTION_TIMES); max = srs_max(max, SRS_SYS_DISK_STAT_RESOLUTION_TIMES); @@ -911,7 +910,6 @@ srs_error_t SrsServer::do_cycle() max = srs_max(max, SRS_SYS_PLATFORM_INFO_RESOLUTION_TIMES); max = srs_max(max, SRS_SYS_NETWORK_DEVICE_RESOLUTION_TIMES); max = srs_max(max, SRS_SYS_NETWORK_RTMP_SERVER_RESOLUTION_TIMES); -#endif // for asprocess. bool asprocess = _srs_config->get_asprocess(); @@ -988,7 +986,6 @@ srs_error_t SrsServer::do_cycle() srs_update_system_time_ms(); } -#ifdef SRS_AUTO_STAT if ((i % SRS_SYS_RUSAGE_RESOLUTION_TIMES) == 0) { srs_info("update resource info, rss."); srs_update_system_rusage(); @@ -1023,7 +1020,6 @@ srs_error_t SrsServer::do_cycle() http_heartbeat->heartbeat(); } } -#endif srs_info("server main thread loop"); } diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index 933a5752e..3e4c46a23 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -230,7 +230,7 @@ void show_macro_features() // inge(ingest) ss << ", inge:" << srs_bool2switch(SRS_AUTO_INGEST_BOOL); ss << ", kafka:" << srs_bool2switch(SRS_AUTO_KAFKA_BOOL); - ss << ", stat:" << srs_bool2switch(SRS_AUTO_STAT_BOOL); + ss << ", stat:" << srs_bool2switch(true); ss << ", nginx:" << srs_bool2switch(SRS_AUTO_NGINX_BOOL); // ff(ffmpeg) ss << ", ff:" << srs_bool2switch(SRS_AUTO_FFMPEG_TOOL_BOOL); From 0bc7fdbb35849519f7abf23ad18ccd43ac1b6a2a Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 22 Dec 2018 20:03:40 +0800 Subject: [PATCH 5/9] Always enable SRS_SSL --- trunk/auto/auto_headers.sh | 6 ------ trunk/auto/options.sh | 3 ++- trunk/src/app/srs_app_hls.cpp | 17 +---------------- trunk/src/app/srs_app_http_api.cpp | 4 ---- trunk/src/kernel/srs_kernel_ts.cpp | 5 ----- trunk/src/kernel/srs_kernel_ts.hpp | 2 -- trunk/src/libs/srs_librtmp.cpp | 5 ----- trunk/src/main/srs_main_server.cpp | 2 +- trunk/src/protocol/srs_rtmp_handshake.cpp | 20 -------------------- trunk/src/protocol/srs_rtmp_handshake.hpp | 4 ---- trunk/src/utest/srs_utest_protocol.cpp | 4 ---- trunk/src/utest/srs_utest_protocol.hpp | 2 -- 12 files changed, 4 insertions(+), 70 deletions(-) diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index adfe0251c..5dbc31423 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -103,12 +103,6 @@ else srs_undefine_macro "SRS_AUTO_HDS" $SRS_AUTO_HEADERS_H fi -if [ $SRS_SSL = YES ]; then - srs_define_macro "SRS_AUTO_SSL" $SRS_AUTO_HEADERS_H -else - srs_undefine_macro "SRS_AUTO_SSL" $SRS_AUTO_HEADERS_H -fi - if [ $SRS_MEM_WATCH = YES ]; then srs_define_macro "SRS_AUTO_MEM_WATCH" $SRS_AUTO_HEADERS_H else diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 42742a033..77f53b925 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -17,7 +17,6 @@ help=no # feature options SRS_HDS=RESERVED SRS_NGINX=RESERVED -SRS_SSL=RESERVED SRS_FFMPEG_TOOL=RESERVED SRS_INGEST=RESERVED SRS_STREAM_CASTER=RESERVED @@ -39,6 +38,7 @@ SRS_GPERF_CP=RESERVED SRS_GPROF=RESERVED # # Always enable the bellow features. +SRS_SSL=YES SRS_STAT=YES SRS_TRANSCODE=YES SRS_HTTP_CALLBACK=YES @@ -681,6 +681,7 @@ function apply_user_detail_options() { # Always enable HTTP utilies. if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable HTTP utilies.${BLACK}"; fi + if [ $SRS_SSL = NO ]; then SRS_SSL=YES; echo -e "${YELLOW}[WARN] Always enable SSL.${BLACK}"; fi if [ $SRS_STAT = NO ]; then SRS_STAT=YES; echo -e "${YELLOW}[WARN] Always enable Statistic.${BLACK}"; fi if [ $SRS_TRANSCODE = NO ]; then SRS_TRANSCODE=YES; echo -e "${YELLOW}[WARN] Always enable Transcode.${BLACK}"; fi if [ $SRS_HTTP_CALLBACK = NO ]; then SRS_HTTP_CALLBACK=YES; echo -e "${YELLOW}[WARN] Always enable HTTP callback.${BLACK}"; fi diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp index ef40588a3..81e42e0ad 100644 --- a/trunk/src/app/srs_app_hls.cpp +++ b/trunk/src/app/srs_app_hls.cpp @@ -51,10 +51,7 @@ using namespace std; #include #include #include - -#ifdef SRS_AUTO_SSL #include -#endif // drop the segment when duration of ts too small. #define SRS_AUTO_HLS_SEGMENT_MIN_DURATION_MS 100 @@ -80,10 +77,8 @@ void SrsHlsSegment::config_cipher(unsigned char* key,unsigned char* iv) { memcpy(this->iv, iv,16); -#ifdef SRS_AUTO_SSL SrsEncFileWriter* fw = (SrsEncFileWriter*)writer; fw->config_cipher(key, iv); -#endif } SrsDvrAsyncCallOnHls::SrsDvrAsyncCallOnHls(int c, SrsRequest* r, string p, string t, string m, string mu, int s, double d) @@ -334,11 +329,7 @@ srs_error_t SrsHlsMuxer::update_config(SrsRequest* r, string entry_prefix, } if(hls_keys) { -#ifdef SRS_AUTO_SSL writer = new SrsEncFileWriter(); -#else - writer = new SrsFileWriter(); -#endif } else { writer = new SrsFileWriter(); } @@ -656,13 +647,10 @@ srs_error_t SrsHlsMuxer::write_hls_key() { srs_error_t err = srs_success; -#ifndef SRS_AUTO_SSL if (hls_keys) { srs_warn("SSL is disabled, ignore HLS key"); } -#endif -#ifdef SRS_AUTO_SSL if (hls_keys && current->sequence_no % hls_fragments_per_key == 0) { if (RAND_bytes(key, 16) < 0) { return srs_error_wrap(err, "rand key failed."); @@ -691,7 +679,6 @@ srs_error_t SrsHlsMuxer::write_hls_key() if (hls_keys) { current->config_cipher(key, iv); } -#endif return err; } @@ -774,8 +761,7 @@ srs_error_t SrsHlsMuxer::_refresh_m3u8(string m3u8_file) // #EXT-X-DISCONTINUITY\n ss << "#EXT-X-DISCONTINUITY" << SRS_CONSTS_LF; } - -#ifdef SRS_AUTO_SSL + if(hls_keys && ((segment->sequence_no % hls_fragments_per_key) == 0)) { char hexiv[33]; srs_data_to_hex(hexiv, segment->iv, 16); @@ -792,7 +778,6 @@ srs_error_t SrsHlsMuxer::_refresh_m3u8(string m3u8_file) ss << "#EXT-X-KEY:METHOD=AES-128,URI=" << "\"" << key_path << "\",IV=0x" << hexiv << SRS_CONSTS_LF; } -#endif // "#EXTINF:4294967295.208,\n" ss.precision(3); diff --git a/trunk/src/app/srs_app_http_api.cpp b/trunk/src/app/srs_app_http_api.cpp index 7339b25db..01fb10738 100644 --- a/trunk/src/app/srs_app_http_api.cpp +++ b/trunk/src/app/srs_app_http_api.cpp @@ -588,11 +588,7 @@ srs_error_t SrsGoApiFeatures::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess SrsJsonObject* features = SrsJsonAny::object(); data->set("features", features); -#ifdef SRS_AUTO_SSL features->set("ssl", SrsJsonAny::boolean(true)); -#else - features->set("ssl", SrsJsonAny::boolean(false)); -#endif features->set("hls", SrsJsonAny::boolean(true)); #ifdef SRS_AUTO_HDS features->set("hds", SrsJsonAny::boolean(true)); diff --git a/trunk/src/kernel/srs_kernel_ts.cpp b/trunk/src/kernel/srs_kernel_ts.cpp index 354ee825b..59a8ad455 100644 --- a/trunk/src/kernel/srs_kernel_ts.cpp +++ b/trunk/src/kernel/srs_kernel_ts.cpp @@ -34,11 +34,8 @@ #include using namespace std; -#ifdef SRS_AUTO_SSL #include #include -#endif - #include #include #include @@ -2616,7 +2613,6 @@ SrsVideoCodecId SrsTsContextWriter::video_codec() return vcodec; } -#ifdef SRS_AUTO_SSL SrsEncFileWriter::SrsEncFileWriter() { memset(iv,0,16); @@ -2703,7 +2699,6 @@ void SrsEncFileWriter::close() SrsFileWriter::close(); } -#endif SrsTsMessageCache::SrsTsMessageCache() { diff --git a/trunk/src/kernel/srs_kernel_ts.hpp b/trunk/src/kernel/srs_kernel_ts.hpp index 6d1830826..bd9348701 100644 --- a/trunk/src/kernel/srs_kernel_ts.hpp +++ b/trunk/src/kernel/srs_kernel_ts.hpp @@ -1572,7 +1572,6 @@ public: virtual SrsVideoCodecId video_codec(); }; -#ifdef SRS_AUTO_SSL /* * Used for HLS Encryption */ @@ -1593,7 +1592,6 @@ private: char* buf; int nb_buf; }; -#endif /** * TS messages cache, to group frames to TS message, diff --git a/trunk/src/libs/srs_librtmp.cpp b/trunk/src/libs/srs_librtmp.cpp index 388604607..7b24e90f5 100644 --- a/trunk/src/libs/srs_librtmp.cpp +++ b/trunk/src/libs/srs_librtmp.cpp @@ -653,10 +653,6 @@ int srs_rtmp_connect_server(srs_rtmp_t rtmp) int srs_rtmp_do_complex_handshake(srs_rtmp_t rtmp) { -#ifndef SRS_AUTO_SSL - // complex handshake requires ssl - return ERROR_RTMP_HS_SSL_REQUIRE; -#else int ret = ERROR_SUCCESS; srs_error_t err = srs_success; @@ -676,7 +672,6 @@ int srs_rtmp_do_complex_handshake(srs_rtmp_t rtmp) } return ret; -#endif } int srs_rtmp_do_simple_handshake(srs_rtmp_t rtmp) diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index 3e4c46a23..09f6867c4 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -212,7 +212,7 @@ void show_macro_features() ss << "features"; // rch(rtmp complex handshake) - ss << ", rch:" << srs_bool2switch(SRS_AUTO_SSL_BOOL); + ss << ", rch:" << srs_bool2switch(true); ss << ", dash:" << "on"; ss << ", hls:" << srs_bool2switch(true); ss << ", hds:" << srs_bool2switch(SRS_AUTO_HDS_BOOL); diff --git a/trunk/src/protocol/srs_rtmp_handshake.cpp b/trunk/src/protocol/srs_rtmp_handshake.cpp index 817990e7e..04aae7266 100644 --- a/trunk/src/protocol/srs_rtmp_handshake.cpp +++ b/trunk/src/protocol/srs_rtmp_handshake.cpp @@ -34,8 +34,6 @@ #include #include -#ifdef SRS_AUTO_SSL - using namespace _srs_internal; // for openssl_HMACsha256 @@ -108,8 +106,6 @@ static int DH_set_length(DH *dh, long length) return 1; } -#endif - namespace _srs_internal { // 68bytes FMS key which is used to sign the sever packet. @@ -1175,13 +1171,6 @@ SrsComplexHandshake::~SrsComplexHandshake() { } -#ifndef SRS_AUTO_SSL -srs_error_t SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* /*hs_bytes*/, ISrsProtocolReaderWriter* /*io*/) -{ - srs_trace("directly use simple handshake for ssl disabled."); - return srs_error_new(ERROR_RTMP_TRY_SIMPLE_HS, "try simple handshake"); -} -#else srs_error_t SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io) { srs_error_t err = srs_success; @@ -1265,14 +1254,7 @@ srs_error_t SrsComplexHandshake::handshake_with_client(SrsHandshakeBytes* hs_byt return err; } -#endif -#ifndef SRS_AUTO_SSL -srs_error_t SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* /*hs_bytes*/, ISrsProtocolReaderWriter* /*io*/) -{ - return srs_error_new(ERROR_RTMP_TRY_SIMPLE_HS, "try simple handshake"); -} -#else srs_error_t SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_bytes, ISrsProtocolReaderWriter* io) { srs_error_t err = srs_success; @@ -1346,6 +1328,4 @@ srs_error_t SrsComplexHandshake::handshake_with_server(SrsHandshakeBytes* hs_byt return err; } -#endif - diff --git a/trunk/src/protocol/srs_rtmp_handshake.hpp b/trunk/src/protocol/srs_rtmp_handshake.hpp index 5e78ad0fe..109616eee 100644 --- a/trunk/src/protocol/srs_rtmp_handshake.hpp +++ b/trunk/src/protocol/srs_rtmp_handshake.hpp @@ -31,8 +31,6 @@ class SrsComplexHandshake; class SrsHandshakeBytes; class SrsBuffer; -#ifdef SRS_AUTO_SSL - // for openssl. #include @@ -499,8 +497,6 @@ namespace _srs_internal }; } -#endif - /** * simple handshake. * user can try complex handshake first, diff --git a/trunk/src/utest/srs_utest_protocol.cpp b/trunk/src/utest/srs_utest_protocol.cpp index 80dd435c0..f0ce52eb6 100644 --- a/trunk/src/utest/srs_utest_protocol.cpp +++ b/trunk/src/utest/srs_utest_protocol.cpp @@ -214,8 +214,6 @@ srs_error_t MockBufferIO::read(void* buf, size_t size, ssize_t* nread) #ifdef ENABLE_UTEST_PROTOCOL -#ifdef SRS_AUTO_SSL - // verify the sha256 VOID TEST(ProtocolHandshakeTest, OpensslSha256) { @@ -379,8 +377,6 @@ VOID TEST(ProtocolHandshakeTest, ComplexHandshake) } } -#endif - VOID TEST(ProtocolHandshakeTest, SimpleHandshake) { uint8_t c0c1[] = { diff --git a/trunk/src/utest/srs_utest_protocol.hpp b/trunk/src/utest/srs_utest_protocol.hpp index 6b66826f5..e01da1c4e 100644 --- a/trunk/src/utest/srs_utest_protocol.hpp +++ b/trunk/src/utest/srs_utest_protocol.hpp @@ -36,9 +36,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#ifdef SRS_AUTO_SSL using namespace _srs_internal; -#endif #include From e4e6dd21695a9455203fb12d98db22d3c7a48da4 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 22 Dec 2018 20:08:42 +0800 Subject: [PATCH 6/9] Always enable SRS_SSL --- trunk/auto/options.sh | 13 ------------- trunk/configure | 28 +++++++++++++++++++++------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 77f53b925..55b790cd5 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -389,7 +389,6 @@ function apply_user_presets() { if [ $SRS_DISABLE_ALL = YES ]; then SRS_HDS=NO SRS_NGINX=NO - SRS_SSL=NO SRS_FFMPEG_TOOL=NO SRS_INGEST=NO SRS_STREAM_CASTER=NO @@ -410,7 +409,6 @@ function apply_user_presets() { if [ $SRS_ENABLE_ALL = YES ]; then SRS_HDS=YES SRS_NGINX=YES - SRS_SSL=YES SRS_FFMPEG_TOOL=YES SRS_INGEST=YES SRS_STREAM_CASTER=YES @@ -431,7 +429,6 @@ function apply_user_presets() { if [ $SRS_FAST = YES ]; then SRS_HDS=NO SRS_NGINX=NO - SRS_SSL=NO SRS_FFMPEG_TOOL=NO SRS_INGEST=NO SRS_STREAM_CASTER=NO @@ -452,7 +449,6 @@ function apply_user_presets() { if [ $SRS_PURE_RTMP = YES ]; then SRS_HDS=NO SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=NO SRS_STREAM_CASTER=NO @@ -473,7 +469,6 @@ function apply_user_presets() { if [ $SRS_ARM_UBUNTU12 = YES ]; then SRS_HDS=YES SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES SRS_STREAM_CASTER=YES @@ -495,7 +490,6 @@ function apply_user_presets() { if [ $SRS_MIPS_UBUNTU12 = YES ]; then SRS_HDS=YES SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES SRS_STREAM_CASTER=YES @@ -516,7 +510,6 @@ function apply_user_presets() { if [ $SRS_X86_X64 = YES ]; then SRS_HDS=YES SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES SRS_STREAM_CASTER=YES @@ -537,7 +530,6 @@ function apply_user_presets() { if [ $SRS_OSX = YES ]; then SRS_HDS=YES SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES SRS_STREAM_CASTER=YES @@ -561,7 +553,6 @@ function apply_user_presets() { if [ $SRS_DEV = YES ]; then SRS_HDS=YES SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=YES SRS_INGEST=YES SRS_STREAM_CASTER=YES @@ -582,7 +573,6 @@ function apply_user_presets() { if [ $SRS_FAST_DEV = YES ]; then SRS_HDS=YES SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES SRS_STREAM_CASTER=YES @@ -603,7 +593,6 @@ function apply_user_presets() { if [ $SRS_DEMO = YES ]; then SRS_HDS=YES SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=YES SRS_INGEST=YES SRS_STREAM_CASTER=YES @@ -624,7 +613,6 @@ function apply_user_presets() { if [ $SRS_PI = YES ]; then SRS_HDS=YES SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=NO SRS_INGEST=YES SRS_STREAM_CASTER=YES @@ -645,7 +633,6 @@ function apply_user_presets() { if [ $SRS_CUBIE = YES ]; then SRS_HDS=YES SRS_NGINX=NO - SRS_SSL=YES SRS_FFMPEG_TOOL=YES SRS_INGEST=YES SRS_STREAM_CASTER=NO diff --git a/trunk/configure b/trunk/configure index 7cdc239cd..264b37ad2 100755 --- a/trunk/configure +++ b/trunk/configure @@ -101,7 +101,9 @@ SrsGprof=""; SrsGprofLink=""; if [ $SRS_GPROF = YES ]; then SrsGprof=" -pg -lc_p SrsGperf=""; SrsGperfLink=""; if [ $SRS_GPERF = YES ]; then SrsGperfLink=" -lpthread"; fi # the cxx flag generated. CXXFLAGS="${CXXFLAGS} ${CppStd}${WarnLevel}${GDBDebug}${LibraryCompile}${SrsGprof}" -if [ $SRS_GPERF = YES ]; then CXXFLAGS="${CXXFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"; fi +if [ $SRS_GPERF = YES ]; then + CXXFLAGS="${CXXFLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free"; +fi # Start to generate the Makefile. cat << END > ${SRS_OBJS}/${SRS_MAKEFILE} GCC = gcc @@ -126,19 +128,31 @@ END LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a" # openssl-1.1.0e, for the RTMP complex handshake. LibSSLRoot="";LibSSLfile="" -if [ $SRS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = NO ]; then LibSSLRoot="${SRS_OBJS_DIR}/openssl/include"; LibSSLfile="${SRS_OBJS_DIR}/openssl/lib/libssl.a ${SRS_OBJS_DIR}/openssl/lib/libcrypto.a"; fi fi +if [ $SRS_SSL = YES && $SRS_USE_SYS_SSL = NO ]; then + LibSSLRoot="${SRS_OBJS_DIR}/openssl/include"; LibSSLfile="${SRS_OBJS_DIR}/openssl/lib/libssl.a ${SRS_OBJS_DIR}/openssl/lib/libcrypto.a"; +fi # gperftools-2.1, for mem check and mem/cpu profile LibGperfRoot=""; LibGperfFile="" -if [ $SRS_GPERF = YES ]; then LibGperfRoot="${SRS_OBJS_DIR}/gperf/include"; LibGperfFile="${SRS_OBJS_DIR}/gperf/lib/libtcmalloc_and_profiler.a"; fi -if [ $SRS_GPERF_MD = YES ]; then LibGperfFile="${SRS_OBJS_DIR}/gperf/lib/libtcmalloc_debug.a"; fi +if [ $SRS_GPERF = YES ]; then + LibGperfRoot="${SRS_OBJS_DIR}/gperf/include"; LibGperfFile="${SRS_OBJS_DIR}/gperf/lib/libtcmalloc_and_profiler.a"; +fi +if [ $SRS_GPERF_MD = YES ]; then + LibGperfFile="${SRS_OBJS_DIR}/gperf/lib/libtcmalloc_debug.a"; +fi # the link options, always use static link SrsLinkOptions="-ldl"; -if [ $SRS_SSL = YES ]; then if [ $SRS_USE_SYS_SSL = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lssl -lcrypto"; fi fi +if [ $SRS_SSL = YES && $SRS_USE_SYS_SSL = YES ]; then + SrsLinkOptions="${SrsLinkOptions} -lssl -lcrypto"; +fi # if static specified, add static # TODO: FIXME: remove static. -if [ $SRS_STATIC = YES ]; then SrsLinkOptions="${SrsLinkOptions} -static"; fi +if [ $SRS_STATIC = YES ]; then + SrsLinkOptions="${SrsLinkOptions} -static"; +fi # if mips, add -lgcc_eh, or stl compile failed. -if [ $SRS_MIPS_UBUNTU12 = YES ]; then SrsLinkOptions="${SrsLinkOptions} -lgcc_eh"; fi +if [ $SRS_MIPS_UBUNTU12 = YES ]; then + SrsLinkOptions="${SrsLinkOptions} -lgcc_eh"; +fi ##################################################################################### # Modules, compile each module, then link to binary From c6844527fb4b12e92582a67ec72083d30ac5d0ee Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 22 Dec 2018 20:23:39 +0800 Subject: [PATCH 7/9] Always enable SRS_SSL --- trunk/configure | 4 ++-- trunk/src/app/srs_app_hls.cpp | 4 ---- trunk/src/protocol/srs_rtmp_handshake.cpp | 4 ++-- trunk/src/protocol/srs_rtmp_handshake.hpp | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/trunk/configure b/trunk/configure index 264b37ad2..1f0c96d72 100755 --- a/trunk/configure +++ b/trunk/configure @@ -128,7 +128,7 @@ END LibSTRoot="${SRS_OBJS_DIR}/st"; LibSTfile="${LibSTRoot}/libst.a" # openssl-1.1.0e, for the RTMP complex handshake. LibSSLRoot="";LibSSLfile="" -if [ $SRS_SSL = YES && $SRS_USE_SYS_SSL = NO ]; then +if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == NO ]]; then LibSSLRoot="${SRS_OBJS_DIR}/openssl/include"; LibSSLfile="${SRS_OBJS_DIR}/openssl/lib/libssl.a ${SRS_OBJS_DIR}/openssl/lib/libcrypto.a"; fi # gperftools-2.1, for mem check and mem/cpu profile @@ -141,7 +141,7 @@ if [ $SRS_GPERF_MD = YES ]; then fi # the link options, always use static link SrsLinkOptions="-ldl"; -if [ $SRS_SSL = YES && $SRS_USE_SYS_SSL = YES ]; then +if [[ $SRS_SSL == YES && $SRS_USE_SYS_SSL == YES ]]; then SrsLinkOptions="${SrsLinkOptions} -lssl -lcrypto"; fi # if static specified, add static diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp index 81e42e0ad..c361f79b4 100644 --- a/trunk/src/app/srs_app_hls.cpp +++ b/trunk/src/app/srs_app_hls.cpp @@ -647,10 +647,6 @@ srs_error_t SrsHlsMuxer::write_hls_key() { srs_error_t err = srs_success; - if (hls_keys) { - srs_warn("SSL is disabled, ignore HLS key"); - } - if (hls_keys && current->sequence_no % hls_fragments_per_key == 0) { if (RAND_bytes(key, 16) < 0) { return srs_error_wrap(err, "rand key failed."); diff --git a/trunk/src/protocol/srs_rtmp_handshake.cpp b/trunk/src/protocol/srs_rtmp_handshake.cpp index 04aae7266..3e73f2988 100644 --- a/trunk/src/protocol/srs_rtmp_handshake.cpp +++ b/trunk/src/protocol/srs_rtmp_handshake.cpp @@ -106,6 +106,8 @@ static int DH_set_length(DH *dh, long length) return 1; } +#endif + namespace _srs_internal { // 68bytes FMS key which is used to sign the sever packet. @@ -1080,8 +1082,6 @@ namespace _srs_internal } } -#endif - SrsSimpleHandshake::SrsSimpleHandshake() { } diff --git a/trunk/src/protocol/srs_rtmp_handshake.hpp b/trunk/src/protocol/srs_rtmp_handshake.hpp index 109616eee..f43787c30 100644 --- a/trunk/src/protocol/srs_rtmp_handshake.hpp +++ b/trunk/src/protocol/srs_rtmp_handshake.hpp @@ -37,7 +37,7 @@ class SrsBuffer; namespace _srs_internal { // the digest key generate size. -#define SRS_OpensslHashSize 512 + #define SRS_OpensslHashSize 512 extern uint8_t SrsGenuineFMSKey[]; extern uint8_t SrsGenuineFPKey[]; srs_error_t openssl_HMACsha256(const void* key, int key_size, const void* data, int data_size, void* digest); From aa1a5442f9462a663ec48711c6056e84d22aba74 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 22 Dec 2018 20:30:13 +0800 Subject: [PATCH 8/9] Always enable SRS_Ingest --- trunk/auto/auto_headers.sh | 6 -- trunk/auto/options.sh | 94 +----------------------------- trunk/src/app/srs_app_config.cpp | 10 ---- trunk/src/app/srs_app_http_api.cpp | 4 -- trunk/src/app/srs_app_ingest.cpp | 4 -- trunk/src/app/srs_app_ingest.hpp | 3 - trunk/src/app/srs_app_server.cpp | 8 --- trunk/src/app/srs_app_server.hpp | 2 - trunk/src/main/srs_main_server.cpp | 2 +- 9 files changed, 3 insertions(+), 130 deletions(-) diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index 5dbc31423..d3165f78a 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -124,12 +124,6 @@ else srs_undefine_macro "SRS_AUTO_FFMPEG_STUB" $SRS_AUTO_HEADERS_H fi -if [ $SRS_INGEST = YES ]; then - srs_define_macro "SRS_AUTO_INGEST" $SRS_AUTO_HEADERS_H -else - srs_undefine_macro "SRS_AUTO_INGEST" $SRS_AUTO_HEADERS_H -fi - if [ $SRS_GPERF = YES ]; then srs_define_macro "SRS_AUTO_GPERF" $SRS_AUTO_HEADERS_H else diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index 55b790cd5..cb74469d9 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -18,7 +18,6 @@ help=no SRS_HDS=RESERVED SRS_NGINX=RESERVED SRS_FFMPEG_TOOL=RESERVED -SRS_INGEST=RESERVED SRS_STREAM_CASTER=RESERVED SRS_KAFKA=RESERVED SRS_LIBRTMP=RESERVED @@ -38,6 +37,7 @@ SRS_GPERF_CP=RESERVED SRS_GPROF=RESERVED # # Always enable the bellow features. +SRS_INGEST=YES SRS_SSL=YES SRS_STAT=YES SRS_TRANSCODE=YES @@ -390,18 +390,11 @@ function apply_user_presets() { SRS_HDS=NO SRS_NGINX=NO SRS_FFMPEG_TOOL=NO - SRS_INGEST=NO SRS_STREAM_CASTER=NO SRS_KAFKA=NO SRS_LIBRTMP=NO SRS_RESEARCH=NO SRS_UTEST=NO - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -410,18 +403,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=YES SRS_FFMPEG_TOOL=YES - SRS_INGEST=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES SRS_RESEARCH=YES SRS_UTEST=YES - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -430,18 +416,11 @@ function apply_user_presets() { SRS_HDS=NO SRS_NGINX=NO SRS_FFMPEG_TOOL=NO - SRS_INGEST=NO SRS_STREAM_CASTER=NO SRS_KAFKA=NO SRS_LIBRTMP=NO SRS_RESEARCH=NO SRS_UTEST=NO - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -450,18 +429,11 @@ function apply_user_presets() { SRS_HDS=NO SRS_NGINX=NO SRS_FFMPEG_TOOL=NO - SRS_INGEST=NO SRS_STREAM_CASTER=NO SRS_KAFKA=NO SRS_LIBRTMP=NO SRS_RESEARCH=NO SRS_UTEST=NO - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -470,18 +442,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=NO SRS_FFMPEG_TOOL=NO - SRS_INGEST=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES SRS_RESEARCH=NO SRS_UTEST=NO - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO # TODO: FIXME: need static? maybe donot. SRS_STATIC=YES fi @@ -491,18 +456,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=NO SRS_FFMPEG_TOOL=NO - SRS_INGEST=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES SRS_RESEARCH=NO SRS_UTEST=NO - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -511,18 +469,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=NO SRS_FFMPEG_TOOL=NO - SRS_INGEST=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES SRS_RESEARCH=NO SRS_UTEST=YES - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -531,18 +482,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=NO SRS_FFMPEG_TOOL=NO - SRS_INGEST=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES SRS_RESEARCH=NO SRS_UTEST=YES - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO # valgrind is not supported by macOS sierra, read # https://stackoverflow.com/questions/40650338/valgrind-on-macos-sierra @@ -554,18 +498,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=NO SRS_FFMPEG_TOOL=YES - SRS_INGEST=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES SRS_RESEARCH=YES SRS_UTEST=YES - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -574,18 +511,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=NO SRS_FFMPEG_TOOL=NO - SRS_INGEST=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=NO SRS_RESEARCH=NO SRS_UTEST=NO - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -594,18 +524,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=NO SRS_FFMPEG_TOOL=YES - SRS_INGEST=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES SRS_RESEARCH=NO SRS_UTEST=YES - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -614,18 +537,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=NO SRS_FFMPEG_TOOL=NO - SRS_INGEST=YES SRS_STREAM_CASTER=YES SRS_KAFKA=YES SRS_LIBRTMP=YES SRS_RESEARCH=NO SRS_UTEST=NO - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi @@ -634,18 +550,11 @@ function apply_user_presets() { SRS_HDS=YES SRS_NGINX=NO SRS_FFMPEG_TOOL=YES - SRS_INGEST=YES SRS_STREAM_CASTER=NO SRS_KAFKA=YES SRS_LIBRTMP=YES SRS_RESEARCH=NO SRS_UTEST=NO - SRS_GPERF=NO - SRS_GPERF_MC=NO - SRS_GPERF_MD=NO - SRS_GPERF_MP=NO - SRS_GPERF_CP=NO - SRS_GPROF=NO SRS_STATIC=NO fi } @@ -668,6 +577,7 @@ function apply_user_detail_options() { # Always enable HTTP utilies. if [ $SRS_HTTP_CORE = NO ]; then SRS_HTTP_CORE=YES; echo -e "${YELLOW}[WARN] Always enable HTTP utilies.${BLACK}"; fi + if [ $SRS_INGEST = NO ]; then SRS_INGEST=YES; echo -e "${YELLOW}[WARN] Always enable Ingest.${BLACK}"; fi if [ $SRS_SSL = NO ]; then SRS_SSL=YES; echo -e "${YELLOW}[WARN] Always enable SSL.${BLACK}"; fi if [ $SRS_STAT = NO ]; then SRS_STAT=YES; echo -e "${YELLOW}[WARN] Always enable Statistic.${BLACK}"; fi if [ $SRS_TRANSCODE = NO ]; then SRS_TRANSCODE=YES; echo -e "${YELLOW}[WARN] Always enable Transcode.${BLACK}"; fi diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 7a5b5a4fd..6a5cfd87d 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -3895,16 +3895,6 @@ srs_error_t SrsConfig::check_normal_config() if (get_hls_enabled(vhost->arg0())) { srs_warn("can't enable vhost.hls of %s", vhost->arg0().c_str()); } -#ifndef SRS_AUTO_INGEST - vector ingesters = get_ingesters(vhost->arg0()); - for (int j = 0; j < (int)ingesters.size(); j++) { - SrsConfDirective* ingest = ingesters[j]; - if (get_ingest_enabled(ingest)) { - srs_warn("cant' enable vhost.ingest.%s of %s", - ingest->arg0().c_str(), vhost->arg0().c_str()); - } - } -#endif // TODO: FIXME: required http server when hls storage is ram or both. } diff --git a/trunk/src/app/srs_app_http_api.cpp b/trunk/src/app/srs_app_http_api.cpp index 01fb10738..1c2fa6a86 100644 --- a/trunk/src/app/srs_app_http_api.cpp +++ b/trunk/src/app/srs_app_http_api.cpp @@ -600,11 +600,7 @@ srs_error_t SrsGoApiFeatures::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess features->set("httpd", SrsJsonAny::boolean(true)); features->set("dvr", SrsJsonAny::boolean(true)); features->set("transcode", SrsJsonAny::boolean(true)); -#ifdef SRS_AUTO_INGEST features->set("ingest", SrsJsonAny::boolean(true)); -#else - features->set("ingest", SrsJsonAny::boolean(false)); -#endif features->set("stat", SrsJsonAny::boolean(true)); #ifdef SRS_AUTO_NGINX features->set("nginx", SrsJsonAny::boolean(true)); diff --git a/trunk/src/app/srs_app_ingest.cpp b/trunk/src/app/srs_app_ingest.cpp index 4117b88a6..57e293d91 100644 --- a/trunk/src/app/srs_app_ingest.cpp +++ b/trunk/src/app/srs_app_ingest.cpp @@ -23,8 +23,6 @@ #include -#ifdef SRS_AUTO_INGEST - #include using namespace std; @@ -570,5 +568,3 @@ srs_error_t SrsIngester::on_reload_listen() return srs_success; } -#endif - diff --git a/trunk/src/app/srs_app_ingest.hpp b/trunk/src/app/srs_app_ingest.hpp index 991f94067..e0d54e03b 100644 --- a/trunk/src/app/srs_app_ingest.hpp +++ b/trunk/src/app/srs_app_ingest.hpp @@ -26,8 +26,6 @@ #include -#ifdef SRS_AUTO_INGEST - #include #include @@ -115,5 +113,4 @@ public: }; #endif -#endif diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 05b9e7208..36cb3e055 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -485,10 +485,7 @@ SrsServer::SrsServer() http_api_mux = new SrsHttpServeMux(); http_server = new SrsHttpServer(this); http_heartbeat = new SrsHttpHeartbeat(); - -#ifdef SRS_AUTO_INGEST ingester = new SrsIngester(); -#endif } SrsServer::~SrsServer() @@ -505,10 +502,7 @@ void SrsServer::destroy() srs_freep(http_api_mux); srs_freep(http_server); srs_freep(http_heartbeat); - -#ifdef SRS_AUTO_INGEST srs_freep(ingester); -#endif if (pid_fd > 0) { ::close(pid_fd); @@ -810,11 +804,9 @@ srs_error_t SrsServer::ingest() { srs_error_t err = srs_success; -#ifdef SRS_AUTO_INGEST if ((err = ingester->start()) != srs_success) { return srs_error_wrap(err, "ingest start"); } -#endif return err; } diff --git a/trunk/src/app/srs_app_server.hpp b/trunk/src/app/srs_app_server.hpp index 71986e70e..283a3ad1c 100644 --- a/trunk/src/app/srs_app_server.hpp +++ b/trunk/src/app/srs_app_server.hpp @@ -243,9 +243,7 @@ private: SrsHttpServeMux* http_api_mux; SrsHttpServer* http_server; SrsHttpHeartbeat* http_heartbeat; -#ifdef SRS_AUTO_INGEST SrsIngester* ingester; -#endif SrsCoroutineManager* conn_manager; private: /** diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index 09f6867c4..a6570f188 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -228,7 +228,7 @@ void show_macro_features() // trans(transcode) ss << ", trans:" << srs_bool2switch(true); // inge(ingest) - ss << ", inge:" << srs_bool2switch(SRS_AUTO_INGEST_BOOL); + ss << ", inge:" << srs_bool2switch(true); ss << ", kafka:" << srs_bool2switch(SRS_AUTO_KAFKA_BOOL); ss << ", stat:" << srs_bool2switch(true); ss << ", nginx:" << srs_bool2switch(SRS_AUTO_NGINX_BOOL); From 1dc95cba785382b74ede0e5b598b14c0c0ef6a03 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 22 Dec 2018 20:31:47 +0800 Subject: [PATCH 9/9] Always enable SRS_Ingest --- trunk/auto/options.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/trunk/auto/options.sh b/trunk/auto/options.sh index cb74469d9..36ad5c5d6 100755 --- a/trunk/auto/options.sh +++ b/trunk/auto/options.sh @@ -23,19 +23,12 @@ SRS_KAFKA=RESERVED SRS_LIBRTMP=RESERVED SRS_RESEARCH=RESERVED SRS_UTEST=RESERVED -# tcmalloc -SRS_GPERF=RESERVED -# gperf memory check -SRS_GPERF_MC=RESERVED -# gperf memory defence -SRS_GPERF_MD=RESERVED -# gperf memory profile -SRS_GPERF_MP=RESERVED -# gperf cpu profile -SRS_GPERF_CP=RESERVED -# gprof -SRS_GPROF=RESERVED -# +SRS_GPERF=NO # Performance test: tcmalloc +SRS_GPERF_MC=NO # Performance test: gperf memory check +SRS_GPERF_MD=NO # Performance test: gperf memory defence +SRS_GPERF_MP=NO # Performance test: gperf memory profile +SRS_GPERF_CP=NO # Performance test: gperf cpu profile +SRS_GPROF=NO # Performance test: gprof # Always enable the bellow features. SRS_INGEST=YES SRS_SSL=YES