From 12d9351666ee762b63446884d43a7a2f5e72f559 Mon Sep 17 00:00:00 2001 From: xiongguangjie Date: Fri, 22 Mar 2024 20:41:14 +0800 Subject: [PATCH] Fix compile error for enable_webrtc is off ( #3393 #3397) --- api/source/mk_events.cpp | 6 +++++- api/source/mk_events_objects.cpp | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/api/source/mk_events.cpp b/api/source/mk_events.cpp index 52ac6e57..7f5ed661 100644 --- a/api/source/mk_events.cpp +++ b/api/source/mk_events.cpp @@ -14,7 +14,10 @@ #include "Http/HttpSession.h" #include "Rtsp/RtspSession.h" #include "Record/MP4Recorder.h" + +#ifdef ENABLE_WEBRTC #include "webrtc/WebRtcTransport.h" +#endif using namespace toolkit; 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()); } }); - +#ifdef ENABLE_WEBRTC NoticeCenter::Instance().addListener(&s_tag, Broadcast::kBroadcastRtcSctpConnecting,[](BroadcastRtcSctpConnectArgs){ if (s_events.on_mk_rtc_sctp_connecting) { 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); } }); +#endif }); } diff --git a/api/source/mk_events_objects.cpp b/api/source/mk_events_objects.cpp index 89b8c659..c30fd0cd 100644 --- a/api/source/mk_events_objects.cpp +++ b/api/source/mk_events_objects.cpp @@ -17,7 +17,10 @@ #include "Http/HttpClient.h" #include "Rtsp/RtspSession.h" + +#ifdef ENABLE_WEBRTC #include "webrtc/WebRtcTransport.h" +#endif using namespace toolkit; using namespace mediakit;