修复webrtc echo test无法在chrome上使用的问题

This commit is contained in:
ziyue
2021-10-18 17:35:14 +08:00
parent 03655a71b2
commit 4dcac10b3a
2 changed files with 12 additions and 0 deletions

View File

@@ -34,3 +34,14 @@ void WebRtcEchoTest::onRtp(const char *buf, size_t len, uint64_t stamp_ms) {
void WebRtcEchoTest::onRtcp(const char *buf, size_t len) {
sendRtcpPacket(buf, len, true, nullptr);
}
//修改mline的a=msid属性目的是在echo test的情况下如果offer和answer的msid相同chrome会忽略远端的track
void WebRtcEchoTest::onCheckSdp(SdpType type, RtcSession &sdp) {
if (type == SdpType::answer) {
for (auto &m : sdp.media) {
for (auto &ssrc : m.rtp_rtx_ssrc) {
ssrc.msid = "zlmediakit msid";
}
}
}
}