fix rtsp compiling warning. v7.0.91 (#4504)

## steps to produce:

1. ./configure --rtsp=off
2. make

---------

Co-authored-by: winlin <winlinvip@gmail.com>
This commit is contained in:
Jacob Su 2025-09-20 23:38:07 +08:00 committed by GitHub
parent 20f6cd595c
commit f4c54ab9a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 23 additions and 8 deletions

View File

@ -7,6 +7,7 @@ The changelog for SRS.
<a name="v7-changes"></a>
## 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)

View File

@ -9,7 +9,6 @@
#include <srs_core.hpp>
#include <inttypes.h>
#include <map>
#include <string>
#include <vector>

View File

@ -19,7 +19,6 @@
#endif
#include <srs_app_rtc_source.hpp>
#include <vector>
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<SrsRtcSource> rtc_source)
@ -88,10 +97,12 @@ void SrsRtmpBridge::enable_rtmp2rtc(SrsSharedPtr<SrsRtcSource> rtc_source)
rtc_target_ = rtc_source;
}
#ifdef SRS_RTSP
void SrsRtmpBridge::enable_rtmp2rtsp(SrsSharedPtr<SrsRtspSource> rtsp_source)
{
rtsp_target_ = rtsp_source;
}
#endif
srs_error_t SrsRtmpBridge::initialize(ISrsRequest *r)
{

View File

@ -12,8 +12,6 @@
#include <srs_core_autofree.hpp>
#include <srs_kernel_codec.hpp>
#include <vector>
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<SrsRtcSource> rtc_target_;
#ifdef SRS_RTSP
SrsSharedPtr<SrsRtspSource> rtsp_target_;
#endif
public:
SrsRtmpBridge();
@ -103,7 +105,9 @@ public:
public:
bool empty();
void enable_rtmp2rtc(SrsSharedPtr<SrsRtcSource> rtc_source);
#ifdef SRS_RTSP
void enable_rtmp2rtsp(SrsSharedPtr<SrsRtspSource> rtsp_source);
#endif
public:
virtual srs_error_t initialize(ISrsRequest *r);

View File

@ -9,6 +9,6 @@
#define VERSION_MAJOR 7
#define VERSION_MINOR 0
#define VERSION_REVISION 90
#define VERSION_REVISION 91
#endif