diff --git a/trunk/auto/auto_headers.sh b/trunk/auto/auto_headers.sh index 10e76e99f..96f5526d3 100755 --- a/trunk/auto/auto_headers.sh +++ b/trunk/auto/auto_headers.sh @@ -70,6 +70,12 @@ else srs_undefine_macro "SRS_AUTO_HDS" $SRS_AUTO_HEADERS_H fi +if [ $SRS_SRT = YES ]; then + srs_define_macro "SRS_AUTO_SRT" $SRS_AUTO_HEADERS_H +else + srs_undefine_macro "SRS_AUTO_SRT" $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/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 62d97fd97..c85930da3 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -688,9 +688,11 @@ srs_error_t SrsServer::listen() if ((err = conn_manager->start()) != srs_success) { return srs_error_wrap(err, "connection manager"); } +#ifdef SRS_AUTO_SRT if ((err = listen_srt()) != srs_success) { return srs_error_wrap(err, "srt listen"); } +#endif return err; } @@ -1007,6 +1009,7 @@ srs_error_t SrsServer::do_cycle() return err; } +#ifdef SRS_AUTO_SRT srs_error_t SrsServer::listen_srt() { srs_error_t err = srs_success; @@ -1030,6 +1033,7 @@ srs_error_t SrsServer::listen_srt() { } return err; } +#endif srs_error_t SrsServer::listen_rtmp() { diff --git a/trunk/src/app/srs_app_server.hpp b/trunk/src/app/srs_app_server.hpp index c03fc996a..a852f0a14 100644 --- a/trunk/src/app/srs_app_server.hpp +++ b/trunk/src/app/srs_app_server.hpp @@ -36,8 +36,10 @@ #include #include #include +#ifdef SRS_AUTO_SRT #include "../srt/srt_server.hpp" #include "../srt/srt_to_rtmp.hpp" +#endif class SrsServer; class SrsConnection; @@ -211,11 +213,10 @@ private: SrsHttpHeartbeat* http_heartbeat; SrsIngester* ingester; SrsCoroutineManager* conn_manager; - -private: +#ifdef SRS_AUTO_SRT //srt server SRT_SERVER_PTR srt_ptr; - +#endif private: // The pid file fd, lock the file write when server is running. // @remark the init.d script should cleanup the pid file, when stop service, @@ -286,8 +287,10 @@ private: virtual srs_error_t listen_http_api(); virtual srs_error_t listen_http_stream(); virtual srs_error_t listen_stream_caster(); +#ifdef SRS_AUTO_SRT //start listen srt udp port virtual srs_error_t listen_srt(); +#endif // Close the listeners for specified type, // Remove the listen object from manager. virtual void close_listeners(SrsListenerType type); diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index 3bfd9ebb1..797e0d90a 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -214,6 +214,7 @@ void show_macro_features() ss << ", dash:" << "on"; ss << ", hls:" << srs_bool2switch(true); ss << ", hds:" << srs_bool2switch(SRS_AUTO_HDS_BOOL); + ss << ", srt:" << srs_bool2switch(SRS_AUTO_SRT_BOOL); // hc(http callback) ss << ", hc:" << srs_bool2switch(true); // ha(http api)