From 0a025fc4b68b1434102af85761ade6c8b55e8a90 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 9 Aug 2022 18:31:55 +0800 Subject: [PATCH] Remove unneccessary depends headers. --- trunk/configure | 32 +++++++++----------------- trunk/ide/srs_clion/CMakeLists.txt | 1 - trunk/src/app/srs_app_srt_listener.cpp | 6 ++--- trunk/src/app/srs_app_st.cpp | 7 ++---- trunk/src/app/srs_app_st.hpp | 4 ---- trunk/src/core/srs_core.hpp | 2 +- trunk/src/protocol/srs_protocol_st.cpp | 12 ++++++++++ trunk/src/protocol/srs_protocol_st.hpp | 6 +++++ 8 files changed, 34 insertions(+), 36 deletions(-) diff --git a/trunk/configure b/trunk/configure index 3a8db074d..4ee6f64ee 100755 --- a/trunk/configure +++ b/trunk/configure @@ -142,11 +142,11 @@ fi # FFMPEG for WebRTC transcoding, such as aac to opus. if [[ $SRS_FFMPEG_FIT == YES ]]; then - LibFfmpegRoot="${SRS_OBJS_DIR}/ffmpeg/include"; LibFfmpegFile="${SRS_OBJS_DIR}/ffmpeg/lib/libavcodec.a ${SRS_OBJS_DIR}/ffmpeg/lib/libswresample.a ${SRS_OBJS_DIR}/ffmpeg/lib/libavutil.a" - if [[ $SRS_CROSS_BUILD == NO ]]; then - LibFfmpegRoot="${LibFfmpegRoot} ${SRS_OBJS_DIR}/opus/include"; LibFfmpegFile="${LibFfmpegFile} ${SRS_OBJS_DIR}/opus/lib/libopus.a" - fi - if [[ $SRS_SHARED_FFMPEG == YES ]]; then LibFfmpegFile="-L${SRS_OBJS_DIR}/ffmpeg/lib -lavcodec -lswresample -lavutil -L${SRS_OBJS_DIR}/opus/lib -lopus"; fi + LibFfmpegRoot="${SRS_OBJS_DIR}/ffmpeg/include"; LibFfmpegFile="${SRS_OBJS_DIR}/ffmpeg/lib/libavcodec.a ${SRS_OBJS_DIR}/ffmpeg/lib/libswresample.a ${SRS_OBJS_DIR}/ffmpeg/lib/libavutil.a" + if [[ $SRS_CROSS_BUILD == NO ]]; then + LibFfmpegFile="${LibFfmpegFile} ${SRS_OBJS_DIR}/opus/lib/libopus.a" + fi + if [[ $SRS_SHARED_FFMPEG == YES ]]; then LibFfmpegFile="-L${SRS_OBJS_DIR}/ffmpeg/lib -lavcodec -lswresample -lavutil -L${SRS_OBJS_DIR}/opus/lib -lopus"; fi fi # openssl-1.1.0e, for the RTMP complex handshake. @@ -235,10 +235,6 @@ if [[ $SRS_SRT == YES ]]; then fi if [[ $SRS_RTC == YES ]]; then MODULE_FILES+=("srs_protocol_rtc_stun") - ModuleLibIncs+=(${LibSrtpRoot}) -fi -if [[ $SRS_FFMPEG_FIT == YES ]]; then - ModuleLibIncs+=("${LibFfmpegRoot[*]}") fi PROTOCOL_INCS="src/protocol"; MODULE_DIR=${PROTOCOL_INCS} . auto/modules.sh PROTOCOL_OBJS="${MODULE_OBJS[@]}" @@ -247,7 +243,7 @@ PROTOCOL_OBJS="${MODULE_OBJS[@]}" #App Module, for SRS server only. MODULE_ID="APP" MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL") -ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibSSLRoot}) +ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSSLRoot}) if [ $SRS_GPERF = YES ]; then ModuleLibIncs+=(${LibGperfRoot}) fi @@ -257,9 +253,6 @@ fi if [[ $SRS_FFMPEG_FIT == YES ]]; then ModuleLibIncs+=("${LibFfmpegRoot[*]}") fi -if [[ $SRS_SRT == YES ]]; then - ModuleLibIncs+=("${LibSRTRoot[*]}") -fi MODULE_FILES=("srs_app_server" "srs_app_conn" "srs_app_rtmp_conn" "srs_app_source" "srs_app_refer" "srs_app_hls" "srs_app_forward" "srs_app_encoder" "srs_app_http_stream" "srs_app_bandwidth" "srs_app_st" "srs_app_log" "srs_app_config" @@ -295,16 +288,13 @@ APP_OBJS="${MODULE_OBJS[@]}" #Server Module, for SRS only. MODULE_ID="SERVER" MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP") -ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibGperfRoot} ${LibSSLRoot}) +ModuleLibIncs=(${SRS_OBJS_DIR} ${LibGperfRoot} ${LibSSLRoot}) if [[ $SRS_RTC == YES ]]; then ModuleLibIncs+=(${LibSrtpRoot}) fi if [[ $SRS_FFMPEG_FIT == YES ]]; then ModuleLibIncs+=("${LibFfmpegRoot[*]}") fi -if [[ $SRS_SRT == YES ]]; then - ModuleLibIncs+=(${LibSRTRoot}) -fi MODULE_FILES=("srs_main_server") SERVER_INCS="src/main"; MODULE_DIR=${SERVER_INCS} . auto/modules.sh SERVER_OBJS="${MODULE_OBJS[@]}" @@ -312,16 +302,13 @@ SERVER_OBJS="${MODULE_OBJS[@]}" #Main Module, for app from modules. MODULE_ID="MAIN" MODULE_DEPENDS=("CORE" "KERNEL" "PROTOCOL" "APP") -ModuleLibIncs=(${SRS_OBJS_DIR} ${LibSTRoot} ${LibGperfRoot} ${LibSSLRoot}) +ModuleLibIncs=(${SRS_OBJS_DIR} ${LibGperfRoot} ${LibSSLRoot}) if [[ $SRS_RTC == YES ]]; then ModuleLibIncs+=(${LibSrtpRoot}) fi if [[ $SRS_FFMPEG_FIT == YES ]]; then ModuleLibIncs+=("${LibFfmpegRoot[*]}") fi -if [[ $SRS_SRT == YES ]]; then - ModuleLibIncs+=(${LibSRTRoot}) -fi MODULE_FILES=() DEFINES="" # add each modules for main @@ -382,6 +369,9 @@ fi if [[ $SRS_FFMPEG_FIT == YES ]]; then ModuleLibFiles+=("${LibFfmpegFile[*]}") fi +if [[ $SRS_SRT == YES ]]; then + ModuleLibFiles+=("${LibSRTfile[*]}") +fi # for SRS_MODULE in ${SRS_MODULES[*]}; do . auto/reset_module.sh && . $SRS_MODULE/config diff --git a/trunk/ide/srs_clion/CMakeLists.txt b/trunk/ide/srs_clion/CMakeLists.txt index 6bb9eedba..a21ccf578 100755 --- a/trunk/ide/srs_clion/CMakeLists.txt +++ b/trunk/ide/srs_clion/CMakeLists.txt @@ -61,7 +61,6 @@ INCLUDE_DIRECTORIES(${SRS_DIR}/objs ${SRS_DIR}/objs/st ${SRS_DIR}/objs/openssl/include ${SRS_DIR}/objs/srtp2/include - ${SRS_DIR}/objs/opus/include ${SRS_DIR}/objs/ffmpeg/include ${SRS_DIR}/objs/srt/include ${SRS_DIR}/src/core diff --git a/trunk/src/app/srs_app_srt_listener.cpp b/trunk/src/app/srs_app_srt_listener.cpp index 1b721daec..379449da5 100644 --- a/trunk/src/app/srs_app_srt_listener.cpp +++ b/trunk/src/app/srs_app_srt_listener.cpp @@ -6,8 +6,6 @@ #include -#include - using namespace std; #include @@ -64,8 +62,8 @@ srs_error_t SrsSrtListener::listen() srt_skt_ = new SrsSrtSocket(_srt_eventloop->poller(), lfd_); // Accept never timeout. - srt_skt_->set_recv_timeout(ST_UTIME_NO_TIMEOUT); - srt_skt_->set_send_timeout(ST_UTIME_NO_TIMEOUT); + srt_skt_->set_recv_timeout(SRS_UTIME_NO_TIMEOUT); + srt_skt_->set_send_timeout(SRS_UTIME_NO_TIMEOUT); srs_freep(trd_); trd_ = new SrsSTCoroutine("srt_listener", this); diff --git a/trunk/src/app/srs_app_st.cpp b/trunk/src/app/srs_app_st.cpp index 376e467b6..d2576d3b5 100755 --- a/trunk/src/app/srs_app_st.cpp +++ b/trunk/src/app/srs_app_st.cpp @@ -6,7 +6,6 @@ #include -#include #include using namespace std; @@ -115,8 +114,6 @@ const SrsContextId& SrsSTCoroutine::cid() return impl_->cid(); } -_ST_THREAD_CREATE_PFN _pfn_st_thread_create = (_ST_THREAD_CREATE_PFN)st_thread_create; - SrsFastCoroutine::SrsFastCoroutine(string n, ISrsCoroutineHandler* h) { // TODO: FIXME: Reduce duplicated code. @@ -208,7 +205,7 @@ void SrsFastCoroutine::stop() // When not started, the trd is NULL. if (trd) { void* res = NULL; - int r0 = st_thread_join((st_thread_t)trd, &res); + int r0 = srs_thread_join(trd, &res); if (r0) { // By st_thread_join if (errno == EINVAL) srs_assert(!r0); @@ -252,7 +249,7 @@ void SrsFastCoroutine::interrupt() // Note that if another thread is stopping thread and waiting in st_thread_join, // the interrupt will make the st_thread_join fail. - st_thread_interrupt((st_thread_t)trd); + srs_thread_interrupt(trd); } const SrsContextId& SrsFastCoroutine::cid() diff --git a/trunk/src/app/srs_app_st.hpp b/trunk/src/app/srs_app_st.hpp index e984674c8..235614acd 100644 --- a/trunk/src/app/srs_app_st.hpp +++ b/trunk/src/app/srs_app_st.hpp @@ -142,10 +142,6 @@ public: virtual const SrsContextId& cid(); }; -// For utest to mock the thread create. -typedef void* (*_ST_THREAD_CREATE_PFN)(void *(*start)(void *arg), void *arg, int joinable, int stack_size); -extern _ST_THREAD_CREATE_PFN _pfn_st_thread_create; - // High performance coroutine. class SrsFastCoroutine { diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 7be007663..b6e9b4a1b 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -20,7 +20,7 @@ // The project informations, may sent to client in HTTP header or RTMP metadata. #define RTMP_SIG_SRS_KEY "SRS" -#define RTMP_SIG_SRS_CODE "Leo" +#define RTMP_SIG_SRS_CODE "Bee" #define RTMP_SIG_SRS_URL "https://github.com/ossrs/srs" #define RTMP_SIG_SRS_LICENSE "MIT" #define SRS_CONSTRIBUTORS "https://github.com/ossrs/srs/blob/develop/trunk/AUTHORS.md#contributors" diff --git a/trunk/src/protocol/srs_protocol_st.cpp b/trunk/src/protocol/srs_protocol_st.cpp index 9228400c1..559726ebe 100644 --- a/trunk/src/protocol/srs_protocol_st.cpp +++ b/trunk/src/protocol/srs_protocol_st.cpp @@ -147,11 +147,23 @@ void srs_thread_exit(void* retval) st_thread_exit(retval); } +int srs_thread_join(srs_thread_t thread, void **retvalp) +{ + return st_thread_join((st_thread_t)thread, retvalp); +} + +void srs_thread_interrupt(srs_thread_t thread) +{ + st_thread_interrupt((st_thread_t)thread); +} + void srs_thread_yield() { st_thread_yield(); } +_ST_THREAD_CREATE_PFN _pfn_st_thread_create = (_ST_THREAD_CREATE_PFN)st_thread_create; + srs_error_t srs_tcp_connect(string server, int port, srs_utime_t tm, srs_netfd_t* pstfd) { st_utime_t timeout = ST_UTIME_NO_TIMEOUT; diff --git a/trunk/src/protocol/srs_protocol_st.hpp b/trunk/src/protocol/srs_protocol_st.hpp index 9b6de6e89..5603f02e4 100644 --- a/trunk/src/protocol/srs_protocol_st.hpp +++ b/trunk/src/protocol/srs_protocol_st.hpp @@ -41,8 +41,14 @@ extern srs_error_t srs_fd_keepalive(int fd); // Get current coroutine/thread. extern srs_thread_t srs_thread_self(); extern void srs_thread_exit(void* retval); +extern int srs_thread_join(srs_thread_t thread, void **retvalp); +extern void srs_thread_interrupt(srs_thread_t thread); extern void srs_thread_yield(); +// For utest to mock the thread create. +typedef void* (*_ST_THREAD_CREATE_PFN)(void *(*start)(void *arg), void *arg, int joinable, int stack_size); +extern _ST_THREAD_CREATE_PFN _pfn_st_thread_create; + // For client, to open socket and connect to server. // @param tm The timeout in srs_utime_t. extern srs_error_t srs_tcp_connect(std::string server, int port, srs_utime_t tm, srs_netfd_t* pstfd);