新增webrtc播放器datachannel消息广播机制和接口

This commit is contained in:
xia-chu
2023-09-02 12:53:56 +08:00
parent 39dd886ec1
commit e3e7495c90
7 changed files with 52 additions and 1 deletions

View File

@@ -229,6 +229,19 @@ void WebRtcTransport::OnSctpAssociationMessageReceived(
_sctp->SendSctpMessage(params, ppid, msg, len);
}
#endif
void WebRtcTransport::sendDatachannel(uint16_t streamId, uint32_t ppid, const char *msg, size_t len) {
#ifdef ENABLE_SCTP
if (_sctp) {
RTC::SctpStreamParameters params;
params.streamId = streamId;
_sctp->SendSctpMessage(params, ppid, (uint8_t *)msg, len);
}
#else
WarnL << "WebRTC datachannel disabled!";
#endif
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void WebRtcTransport::sendSockData(const char *buf, size_t len, RTC::TransportTuple *tuple) {