支持单独的datachannel通道 (#1894)

* 支持单独的datachannel 通道

* 当仅有datachannel时 ,忽略rtp和rtcp超时

* 单独开启datachannel时,通过dtls包维持心跳

Co-authored-by: xiongziliang <771730766@qq.com>
This commit is contained in:
Dw9
2022-08-20 10:28:19 +08:00
committed by GitHub
parent 39d2255771
commit b7ef766701
4 changed files with 24 additions and 1 deletions

View File

@@ -1311,6 +1311,10 @@ void RtcSession::checkValid() const{
bool have_active_media = false;
for (auto &item : media) {
item.checkValid();
if (TrackApplication == item.type) {
have_active_media = true;
}
switch (item.direction) {
case RtpDirection::sendrecv:
case RtpDirection::sendonly:
@@ -1348,6 +1352,10 @@ bool RtcSession::supportSimulcast() const {
return false;
}
bool RtcSession::isOnlyDatachannel() const {
return 1 == media.size() && TrackApplication == media[0].type;
}
string const SdpConst::kTWCCRtcpFb = "transport-cc";
string const SdpConst::kRembRtcpFb = "goog-remb";
@@ -1596,6 +1604,10 @@ RETRY:
#ifdef ENABLE_SCTP
answer_media.direction = matchDirection(offer_media.direction, configure.direction);
answer_media.candidate = configure.candidate;
answer_media.ice_ufrag = configure.ice_ufrag;
answer_media.ice_pwd = configure.ice_pwd;
answer_media.fingerprint = configure.fingerprint;
answer_media.ice_lite = configure.ice_lite;
#else
answer_media.direction = RtpDirection::inactive;
#endif