From f4c54ab9a56d455fb094d937b0f9b24c6acb0d6f Mon Sep 17 00:00:00 2001 From: Jacob Su Date: Sat, 20 Sep 2025 23:38:07 +0800 Subject: [PATCH] fix rtsp compiling warning. v7.0.91 (#4504) ## steps to produce: 1. ./configure --rtsp=off 2. make --------- Co-authored-by: winlin --- trunk/doc/CHANGELOG.md | 1 + trunk/src/app/srs_app_rtc_source.hpp | 1 - trunk/src/app/srs_app_stream_bridge.cpp | 19 +++++++++++++++---- trunk/src/app/srs_app_stream_bridge.hpp | 8 ++++++-- trunk/src/core/srs_core_version7.hpp | 2 +- 5 files changed, 23 insertions(+), 8 deletions(-) diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index 84ad906a8..d7d03da73 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -7,6 +7,7 @@ The changelog for SRS. ## SRS 7.0 Changelog +* v7.0, 2025-09-20, Merge [#4504](https://github.com/ossrs/srs/pull/4504): fix rtsp compiling warning. v7.0.91 (#4504) * v7.0, 2025-09-19, Merge [#4503](https://github.com/ossrs/srs/pull/4503): AI: Refine RTMP/SRT/RTC bridge. v7.0.90 (#4503) * v7.0, 2025-09-15, RTC2RTMP: Fix sequence number wraparound assertion crashes. v7.0.89 (#4491) * v7.0, 2025-09-14, Merge [#4489](https://github.com/ossrs/srs/pull/4489): Improve coverage for kernel. v7.0.88 (#4489) diff --git a/trunk/src/app/srs_app_rtc_source.hpp b/trunk/src/app/srs_app_rtc_source.hpp index 6a37fd4a1..1adcc5b18 100644 --- a/trunk/src/app/srs_app_rtc_source.hpp +++ b/trunk/src/app/srs_app_rtc_source.hpp @@ -9,7 +9,6 @@ #include -#include #include #include #include diff --git a/trunk/src/app/srs_app_stream_bridge.cpp b/trunk/src/app/srs_app_stream_bridge.cpp index 1b1fa20d7..eefcd50f1 100644 --- a/trunk/src/app/srs_app_stream_bridge.cpp +++ b/trunk/src/app/srs_app_stream_bridge.cpp @@ -19,7 +19,6 @@ #endif #include -#include using namespace std; ISrsFrameTarget::ISrsFrameTarget() @@ -61,9 +60,9 @@ SrsRtmpBridge::SrsRtmpBridge() #endif #ifdef SRS_RTSP rtsp_builder_ = NULL; + rtsp_target_ = NULL; #endif rtc_target_ = NULL; - rtsp_target_ = NULL; } SrsRtmpBridge::~SrsRtmpBridge() @@ -73,14 +72,24 @@ SrsRtmpBridge::~SrsRtmpBridge() #endif #ifdef SRS_RTSP srs_freep(rtsp_builder_); + rtsp_target_ = NULL; #endif rtc_target_ = NULL; - rtsp_target_ = NULL; } bool SrsRtmpBridge::empty() { - return !rtc_target_.get() || !rtsp_target_.get(); + if (rtc_target_.get()) { + return false; + } + +#ifdef SRS_RTSP + if (rtsp_target_.get()) { + return false; + } +#endif + + return true; } void SrsRtmpBridge::enable_rtmp2rtc(SrsSharedPtr rtc_source) @@ -88,10 +97,12 @@ void SrsRtmpBridge::enable_rtmp2rtc(SrsSharedPtr rtc_source) rtc_target_ = rtc_source; } +#ifdef SRS_RTSP void SrsRtmpBridge::enable_rtmp2rtsp(SrsSharedPtr rtsp_source) { rtsp_target_ = rtsp_source; } +#endif srs_error_t SrsRtmpBridge::initialize(ISrsRequest *r) { diff --git a/trunk/src/app/srs_app_stream_bridge.hpp b/trunk/src/app/srs_app_stream_bridge.hpp index aead49ca2..cf06cba2e 100644 --- a/trunk/src/app/srs_app_stream_bridge.hpp +++ b/trunk/src/app/srs_app_stream_bridge.hpp @@ -12,8 +12,6 @@ #include #include -#include - class ISrsRequest; class SrsMediaPacket; class SrsLiveSource; @@ -22,8 +20,10 @@ class SrsRtmpFormat; class SrsMetaCache; class SrsRtpPacket; class SrsRtcRtpBuilder; +#ifdef SRS_RTSP class SrsRtspSource; class SrsRtspRtpBuilder; +#endif class SrsRtcFrameBuilder; class ISrsStreamBridge; class SrsSrtFrameBuilder; @@ -94,7 +94,9 @@ private: #endif // The Source bridge, bridge stream to other source. SrsSharedPtr rtc_target_; +#ifdef SRS_RTSP SrsSharedPtr rtsp_target_; +#endif public: SrsRtmpBridge(); @@ -103,7 +105,9 @@ public: public: bool empty(); void enable_rtmp2rtc(SrsSharedPtr rtc_source); +#ifdef SRS_RTSP void enable_rtmp2rtsp(SrsSharedPtr rtsp_source); +#endif public: virtual srs_error_t initialize(ISrsRequest *r); diff --git a/trunk/src/core/srs_core_version7.hpp b/trunk/src/core/srs_core_version7.hpp index 9e220dfa0..13c13f3d6 100644 --- a/trunk/src/core/srs_core_version7.hpp +++ b/trunk/src/core/srs_core_version7.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 7 #define VERSION_MINOR 0 -#define VERSION_REVISION 90 +#define VERSION_REVISION 91 #endif \ No newline at end of file