diff --git a/api/source/mk_common.cpp b/api/source/mk_common.cpp index f41d2976..48efeb1d 100644 --- a/api/source/mk_common.cpp +++ b/api/source/mk_common.cpp @@ -304,7 +304,7 @@ API_EXPORT void API_CALL mk_webrtc_get_answer_sdp2(void *user_data, on_user_data std::string offer_str = offer; std::shared_ptr ptr(user_data, user_data_free ? user_data_free : [](void *) {}); auto args = std::make_shared(url); - WebRtcPluginManager::Instance().negotiateSdp(*session, type, *args, [offer_str, session, ptr, cb, args](const WebRtcInterface &exchanger) mutable { + WebRtcPluginManager::Instance().negotiateSdp(*session, type, *args, [offer_str, session, ptr, cb](const WebRtcInterface &exchanger) mutable { auto &handler = const_cast(exchanger); try { auto sdp_answer = handler.getAnswerSdp(offer_str); diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 4174a6ad..5f64e073 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -1770,7 +1770,7 @@ void installWebApi() { auto &session = static_cast(sender); auto args = std::make_shared(allArgs, sender.getIdentifier()); - WebRtcPluginManager::Instance().negotiateSdp(session, type, *args, [invoker, val, offer, headerOut, args](const WebRtcInterface &exchanger) mutable { + WebRtcPluginManager::Instance().negotiateSdp(session, type, *args, [invoker, val, offer, headerOut](const WebRtcInterface &exchanger) mutable { auto &handler = const_cast(exchanger); try { val["sdp"] = handler.getAnswerSdp(offer); @@ -1793,7 +1793,7 @@ void installWebApi() { auto &session = static_cast(sender); auto location = std::string(session.overSsl() ? "https://" : "http://") + allArgs["host"] + delete_webrtc_url; auto args = std::make_shared(allArgs, sender.getIdentifier()); - WebRtcPluginManager::Instance().negotiateSdp(session, type, *args, [invoker, offer, headerOut, location, args](const WebRtcInterface &exchanger) mutable { + WebRtcPluginManager::Instance().negotiateSdp(session, type, *args, [invoker, offer, headerOut, location](const WebRtcInterface &exchanger) mutable { auto &handler = const_cast(exchanger); try { // 设置返回类型 diff --git a/webrtc/WebRtcTransport.h b/webrtc/WebRtcTransport.h index 1a410dc9..3f920c68 100644 --- a/webrtc/WebRtcTransport.h +++ b/webrtc/WebRtcTransport.h @@ -35,8 +35,6 @@ extern const std::string kTcpPort; extern const std::string kTimeOutSec; }//namespace RTC -class WebRtcArgs; - class WebRtcInterface { public: virtual ~WebRtcInterface() = default;