Fix compile error for enable_webrtc is off ( #3393 #3397)

This commit is contained in:
xiongguangjie 2024-03-22 20:41:14 +08:00 committed by GitHub
parent 5a137f8b8e
commit 12d9351666
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -14,7 +14,10 @@
#include "Http/HttpSession.h" #include "Http/HttpSession.h"
#include "Rtsp/RtspSession.h" #include "Rtsp/RtspSession.h"
#include "Record/MP4Recorder.h" #include "Record/MP4Recorder.h"
#ifdef ENABLE_WEBRTC
#include "webrtc/WebRtcTransport.h" #include "webrtc/WebRtcTransport.h"
#endif
using namespace toolkit; using namespace toolkit;
using namespace mediakit; using namespace mediakit;
@ -168,7 +171,7 @@ API_EXPORT void API_CALL mk_events_listen(const mk_events *events){
sender.getMediaTuple().stream.c_str(), ssrc.c_str(), ex.getErrCode(), ex.what()); sender.getMediaTuple().stream.c_str(), ssrc.c_str(), ex.getErrCode(), ex.what());
} }
}); });
#ifdef ENABLE_WEBRTC
NoticeCenter::Instance().addListener(&s_tag, Broadcast::kBroadcastRtcSctpConnecting,[](BroadcastRtcSctpConnectArgs){ NoticeCenter::Instance().addListener(&s_tag, Broadcast::kBroadcastRtcSctpConnecting,[](BroadcastRtcSctpConnectArgs){
if (s_events.on_mk_rtc_sctp_connecting) { if (s_events.on_mk_rtc_sctp_connecting) {
s_events.on_mk_rtc_sctp_connecting((mk_rtc_transport)&sender); s_events.on_mk_rtc_sctp_connecting((mk_rtc_transport)&sender);
@ -204,6 +207,7 @@ API_EXPORT void API_CALL mk_events_listen(const mk_events *events){
s_events.on_mk_rtc_sctp_received((mk_rtc_transport)&sender, streamId, ppid, msg, len); s_events.on_mk_rtc_sctp_received((mk_rtc_transport)&sender, streamId, ppid, msg, len);
} }
}); });
#endif
}); });
} }

View File

@ -17,7 +17,10 @@
#include "Http/HttpClient.h" #include "Http/HttpClient.h"
#include "Rtsp/RtspSession.h" #include "Rtsp/RtspSession.h"
#ifdef ENABLE_WEBRTC
#include "webrtc/WebRtcTransport.h" #include "webrtc/WebRtcTransport.h"
#endif
using namespace toolkit; using namespace toolkit;
using namespace mediakit; using namespace mediakit;