mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-23 09:22:21 +08:00
支持单独的datachannel通道 (#1894)
* 支持单独的datachannel 通道 * 当仅有datachannel时 ,忽略rtp和rtcp超时 * 单独开启datachannel时,通过dtls包维持心跳 Co-authored-by: xiongziliang <771730766@qq.com>
This commit is contained in:
@@ -377,7 +377,7 @@ void WebRtcTransportImp::onCreate() {
|
||||
return false;
|
||||
}
|
||||
if (strong_self->_alive_ticker.elapsedTime() > timeoutSec * 1000) {
|
||||
strong_self->onShutdown(SockException(Err_timeout, "接受rtp和rtcp超时"));
|
||||
strong_self->onShutdown(SockException(Err_timeout, "接受rtp/rtcp/datachannel超时"));
|
||||
}
|
||||
return true;
|
||||
},
|
||||
@@ -386,6 +386,15 @@ void WebRtcTransportImp::onCreate() {
|
||||
_twcc_ctx.setOnSendTwccCB([this](uint32_t ssrc, string fci) { onSendTwcc(ssrc, fci); });
|
||||
}
|
||||
|
||||
void WebRtcTransportImp::OnDtlsTransportApplicationDataReceived(const RTC::DtlsTransport *dtlsTransport, const uint8_t *data, size_t len) {
|
||||
WebRtcTransport::OnDtlsTransportApplicationDataReceived(dtlsTransport, data, len);
|
||||
#ifdef ENABLE_SCTP
|
||||
if (_answer_sdp->isOnlyDatachannel()) {
|
||||
_alive_ticker.resetTime();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
WebRtcTransportImp::WebRtcTransportImp(const EventPoller::Ptr &poller)
|
||||
: WebRtcTransport(poller) {
|
||||
InfoL << getIdentifier();
|
||||
|
||||
Reference in New Issue
Block a user