mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix build fail when disable RTC by --rtc=off. 4.0.118
This commit is contained in:
parent
af04285baa
commit
fc9363e7df
6 changed files with 43 additions and 17 deletions
|
@ -176,6 +176,7 @@ The ports used by SRS:
|
||||||
|
|
||||||
## V4 changes
|
## V4 changes
|
||||||
|
|
||||||
|
* v4.0, 2021-05-20, Fix build fail when disable RTC by --rtc=off. 4.0.118
|
||||||
* v4.0, 2021-05-19, Fix [#2362][bug #2362]: Allow WebRTC to play before publishing, for GB28181 as such. 4.0.117
|
* v4.0, 2021-05-19, Fix [#2362][bug #2362]: Allow WebRTC to play before publishing, for GB28181 as such. 4.0.117
|
||||||
* v4.0, 2021-05-18, Fix [#2355][bug #2355]: GB28181: Fix play by RTC bug. 4.0.116
|
* v4.0, 2021-05-18, Fix [#2355][bug #2355]: GB28181: Fix play by RTC bug. 4.0.116
|
||||||
* v4.0, 2021-05-15, SRT: Build SRT from source by SRS. 4.0.115
|
* v4.0, 2021-05-15, SRT: Build SRT from source by SRS. 4.0.115
|
||||||
|
|
|
@ -33,6 +33,8 @@ using namespace std;
|
||||||
#include <srs_protocol_kbps.hpp>
|
#include <srs_protocol_kbps.hpp>
|
||||||
|
|
||||||
SrsPps* _srs_pps_timer = NULL;
|
SrsPps* _srs_pps_timer = NULL;
|
||||||
|
SrsPps* _srs_pps_conn = NULL;
|
||||||
|
SrsPps* _srs_pps_pub = NULL;
|
||||||
|
|
||||||
extern SrsPps* _srs_pps_clock_15ms;
|
extern SrsPps* _srs_pps_clock_15ms;
|
||||||
extern SrsPps* _srs_pps_clock_20ms;
|
extern SrsPps* _srs_pps_clock_20ms;
|
||||||
|
|
|
@ -443,6 +443,7 @@ srs_error_t SrsHybridServer::on_timer(srs_utime_t interval)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
string objs_desc;
|
string objs_desc;
|
||||||
|
#ifdef SRS_RTC
|
||||||
_srs_pps_objs_rtps->update(); _srs_pps_objs_rraw->update(); _srs_pps_objs_rfua->update(); _srs_pps_objs_rbuf->update(); _srs_pps_objs_msgs->update(); _srs_pps_objs_rothers->update();
|
_srs_pps_objs_rtps->update(); _srs_pps_objs_rraw->update(); _srs_pps_objs_rfua->update(); _srs_pps_objs_rbuf->update(); _srs_pps_objs_msgs->update(); _srs_pps_objs_rothers->update();
|
||||||
if (_srs_pps_objs_rtps->r10s() || _srs_pps_objs_rraw->r10s() || _srs_pps_objs_rfua->r10s() || _srs_pps_objs_rbuf->r10s() || _srs_pps_objs_msgs->r10s() || _srs_pps_objs_rothers->r10s()) {
|
if (_srs_pps_objs_rtps->r10s() || _srs_pps_objs_rraw->r10s() || _srs_pps_objs_rfua->r10s() || _srs_pps_objs_rbuf->r10s() || _srs_pps_objs_msgs->r10s() || _srs_pps_objs_rothers->r10s()) {
|
||||||
snprintf(buf, sizeof(buf), ", objs=(pkt:%d,raw:%d,fua:%d,msg:%d,oth:%d,buf:%d)",
|
snprintf(buf, sizeof(buf), ", objs=(pkt:%d,raw:%d,fua:%d,msg:%d,oth:%d,buf:%d)",
|
||||||
|
@ -450,6 +451,7 @@ srs_error_t SrsHybridServer::on_timer(srs_utime_t interval)
|
||||||
_srs_pps_objs_msgs->r10s(), _srs_pps_objs_rothers->r10s(), _srs_pps_objs_rbuf->r10s());
|
_srs_pps_objs_msgs->r10s(), _srs_pps_objs_rothers->r10s(), _srs_pps_objs_rbuf->r10s());
|
||||||
objs_desc = buf;
|
objs_desc = buf;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
srs_trace("Hybrid cpu=%.2f%%,%dMB%s%s%s%s%s%s%s%s%s%s%s",
|
srs_trace("Hybrid cpu=%.2f%%,%dMB%s%s%s%s%s%s%s%s%s%s%s",
|
||||||
u->percent * 100, memory,
|
u->percent * 100, memory,
|
||||||
|
|
|
@ -68,8 +68,6 @@ SrsPps* _srs_pps_srtps = NULL;
|
||||||
SrsPps* _srs_pps_pli = NULL;
|
SrsPps* _srs_pps_pli = NULL;
|
||||||
SrsPps* _srs_pps_twcc = NULL;
|
SrsPps* _srs_pps_twcc = NULL;
|
||||||
SrsPps* _srs_pps_rr = NULL;
|
SrsPps* _srs_pps_rr = NULL;
|
||||||
SrsPps* _srs_pps_pub = NULL;
|
|
||||||
SrsPps* _srs_pps_conn = NULL;
|
|
||||||
|
|
||||||
extern SrsPps* _srs_pps_snack;
|
extern SrsPps* _srs_pps_snack;
|
||||||
extern SrsPps* _srs_pps_snack2;
|
extern SrsPps* _srs_pps_snack2;
|
||||||
|
|
|
@ -31,9 +31,12 @@
|
||||||
#include <srs_app_source.hpp>
|
#include <srs_app_source.hpp>
|
||||||
#include <srs_app_pithy_print.hpp>
|
#include <srs_app_pithy_print.hpp>
|
||||||
#include <srs_app_rtc_server.hpp>
|
#include <srs_app_rtc_server.hpp>
|
||||||
|
#include <srs_app_log.hpp>
|
||||||
|
|
||||||
|
#ifdef SRS_RTC
|
||||||
#include <srs_app_rtc_dtls.hpp>
|
#include <srs_app_rtc_dtls.hpp>
|
||||||
#include <srs_app_rtc_conn.hpp>
|
#include <srs_app_rtc_conn.hpp>
|
||||||
#include <srs_app_log.hpp>
|
#endif
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -43,11 +46,14 @@ extern ISrsContext* _srs_context;
|
||||||
extern SrsConfig* _srs_config;
|
extern SrsConfig* _srs_config;
|
||||||
|
|
||||||
extern SrsStageManager* _srs_stages;
|
extern SrsStageManager* _srs_stages;
|
||||||
|
|
||||||
|
#ifdef SRS_RTC
|
||||||
extern SrsRtcBlackhole* _srs_blackhole;
|
extern SrsRtcBlackhole* _srs_blackhole;
|
||||||
extern SrsResourceManager* _srs_rtc_manager;
|
extern SrsResourceManager* _srs_rtc_manager;
|
||||||
|
|
||||||
extern SrsResourceManager* _srs_rtc_manager;
|
extern SrsResourceManager* _srs_rtc_manager;
|
||||||
extern SrsDtlsCertificate* _srs_rtc_dtls_certificate;
|
extern SrsDtlsCertificate* _srs_rtc_dtls_certificate;
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <srs_protocol_kbps.hpp>
|
#include <srs_protocol_kbps.hpp>
|
||||||
|
|
||||||
|
@ -254,12 +260,24 @@ srs_error_t SrsCircuitBreaker::on_timer(srs_utime_t interval)
|
||||||
// The hybrid thread cpu and memory.
|
// The hybrid thread cpu and memory.
|
||||||
float thread_percent = stat->percent * 100;
|
float thread_percent = stat->percent * 100;
|
||||||
|
|
||||||
if (enabled_ && (hybrid_high_water_level() || hybrid_critical_water_level() || _srs_pps_snack2->r10s())) {
|
static char buf[128];
|
||||||
srs_trace("CircuitBreaker: cpu=%.2f%%,%dMB, break=%d,%d,%d, cond=%.2f%%, snk=%d,%d,%d",
|
|
||||||
|
string snk_desc;
|
||||||
|
#ifdef SRS_RTC
|
||||||
|
if (_srs_pps_snack2->r10s()) {
|
||||||
|
snprintf(buf, sizeof(buf), ", snk=%d,%d,%d",
|
||||||
|
_srs_pps_snack2->r10s(), _srs_pps_snack3->r10s(), _srs_pps_snack4->r10s() // NACK packet,seqs sent.
|
||||||
|
);
|
||||||
|
snk_desc = buf;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (enabled_ && (hybrid_high_water_level() || hybrid_critical_water_level())) {
|
||||||
|
srs_trace("CircuitBreaker: cpu=%.2f%%,%dMB, break=%d,%d,%d, cond=%.2f%%%s",
|
||||||
u->percent * 100, memory,
|
u->percent * 100, memory,
|
||||||
hybrid_high_water_level(), hybrid_critical_water_level(), hybrid_dying_water_level(), // Whether Circuit-Break is enable.
|
hybrid_high_water_level(), hybrid_critical_water_level(), hybrid_dying_water_level(), // Whether Circuit-Break is enable.
|
||||||
thread_percent, // The conditions to enable Circuit-Breaker.
|
thread_percent, // The conditions to enable Circuit-Breaker.
|
||||||
_srs_pps_snack2->r10s(), _srs_pps_snack3->r10s(), _srs_pps_snack4->r10s() // NACK packet,seqs sent.
|
snk_desc.c_str()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -291,15 +309,17 @@ srs_error_t srs_thread_initialize()
|
||||||
|
|
||||||
// The global objects which depends on ST.
|
// The global objects which depends on ST.
|
||||||
_srs_hybrid = new SrsHybridServer();
|
_srs_hybrid = new SrsHybridServer();
|
||||||
_srs_rtc_sources = new SrsRtcSourceManager();
|
|
||||||
_srs_sources = new SrsLiveSourceManager();
|
_srs_sources = new SrsLiveSourceManager();
|
||||||
_srs_stages = new SrsStageManager();
|
_srs_stages = new SrsStageManager();
|
||||||
_srs_blackhole = new SrsRtcBlackhole();
|
|
||||||
_srs_rtc_manager = new SrsResourceManager("RTC", true);
|
|
||||||
_srs_circuit_breaker = new SrsCircuitBreaker();
|
_srs_circuit_breaker = new SrsCircuitBreaker();
|
||||||
|
|
||||||
|
#ifdef SRS_RTC
|
||||||
|
_srs_rtc_sources = new SrsRtcSourceManager();
|
||||||
|
_srs_blackhole = new SrsRtcBlackhole();
|
||||||
|
|
||||||
_srs_rtc_manager = new SrsResourceManager("RTC", true);
|
_srs_rtc_manager = new SrsResourceManager("RTC", true);
|
||||||
_srs_rtc_dtls_certificate = new SrsDtlsCertificate();
|
_srs_rtc_dtls_certificate = new SrsDtlsCertificate();
|
||||||
|
#endif
|
||||||
|
|
||||||
// Initialize global pps, which depends on _srs_clock
|
// Initialize global pps, which depends on _srs_clock
|
||||||
_srs_pps_ids = new SrsPps();
|
_srs_pps_ids = new SrsPps();
|
||||||
|
@ -308,7 +328,10 @@ srs_error_t srs_thread_initialize()
|
||||||
_srs_pps_dispose = new SrsPps();
|
_srs_pps_dispose = new SrsPps();
|
||||||
|
|
||||||
_srs_pps_timer = new SrsPps();
|
_srs_pps_timer = new SrsPps();
|
||||||
|
_srs_pps_conn = new SrsPps();
|
||||||
|
_srs_pps_pub = new SrsPps();
|
||||||
|
|
||||||
|
#ifdef SRS_RTC
|
||||||
_srs_pps_snack = new SrsPps();
|
_srs_pps_snack = new SrsPps();
|
||||||
_srs_pps_snack2 = new SrsPps();
|
_srs_pps_snack2 = new SrsPps();
|
||||||
_srs_pps_snack3 = new SrsPps();
|
_srs_pps_snack3 = new SrsPps();
|
||||||
|
@ -320,6 +343,7 @@ srs_error_t srs_thread_initialize()
|
||||||
_srs_pps_rnack2 = new SrsPps();
|
_srs_pps_rnack2 = new SrsPps();
|
||||||
_srs_pps_rhnack = new SrsPps();
|
_srs_pps_rhnack = new SrsPps();
|
||||||
_srs_pps_rmnack = new SrsPps();
|
_srs_pps_rmnack = new SrsPps();
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(SRS_DEBUG) && defined(SRS_DEBUG_STATS)
|
#if defined(SRS_DEBUG) && defined(SRS_DEBUG_STATS)
|
||||||
_srs_pps_recvfrom = new SrsPps();
|
_srs_pps_recvfrom = new SrsPps();
|
||||||
|
@ -377,30 +401,29 @@ srs_error_t srs_thread_initialize()
|
||||||
_srs_pps_fast_addrs = new SrsPps();
|
_srs_pps_fast_addrs = new SrsPps();
|
||||||
|
|
||||||
_srs_pps_spkts = new SrsPps();
|
_srs_pps_spkts = new SrsPps();
|
||||||
|
_srs_pps_objs_msgs = new SrsPps();
|
||||||
|
|
||||||
|
#ifdef SRS_RTC
|
||||||
_srs_pps_sstuns = new SrsPps();
|
_srs_pps_sstuns = new SrsPps();
|
||||||
_srs_pps_srtcps = new SrsPps();
|
_srs_pps_srtcps = new SrsPps();
|
||||||
_srs_pps_srtps = new SrsPps();
|
_srs_pps_srtps = new SrsPps();
|
||||||
|
|
||||||
_srs_pps_pli = new SrsPps();
|
|
||||||
_srs_pps_twcc = new SrsPps();
|
|
||||||
_srs_pps_rr = new SrsPps();
|
|
||||||
_srs_pps_pub = new SrsPps();
|
|
||||||
_srs_pps_conn = new SrsPps();
|
|
||||||
|
|
||||||
_srs_pps_rstuns = new SrsPps();
|
_srs_pps_rstuns = new SrsPps();
|
||||||
_srs_pps_rrtps = new SrsPps();
|
_srs_pps_rrtps = new SrsPps();
|
||||||
_srs_pps_rrtcps = new SrsPps();
|
_srs_pps_rrtcps = new SrsPps();
|
||||||
|
|
||||||
_srs_pps_aloss2 = new SrsPps();
|
_srs_pps_aloss2 = new SrsPps();
|
||||||
|
|
||||||
_srs_pps_objs_msgs = new SrsPps();
|
_srs_pps_pli = new SrsPps();
|
||||||
|
_srs_pps_twcc = new SrsPps();
|
||||||
|
_srs_pps_rr = new SrsPps();
|
||||||
|
|
||||||
_srs_pps_objs_rtps = new SrsPps();
|
_srs_pps_objs_rtps = new SrsPps();
|
||||||
_srs_pps_objs_rraw = new SrsPps();
|
_srs_pps_objs_rraw = new SrsPps();
|
||||||
_srs_pps_objs_rfua = new SrsPps();
|
_srs_pps_objs_rfua = new SrsPps();
|
||||||
_srs_pps_objs_rbuf = new SrsPps();
|
_srs_pps_objs_rbuf = new SrsPps();
|
||||||
_srs_pps_objs_rothers = new SrsPps();
|
_srs_pps_objs_rothers = new SrsPps();
|
||||||
|
#endif
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 4
|
#define VERSION_MAJOR 4
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 117
|
#define VERSION_REVISION 118
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue