修复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) { void WebRtcEchoTest::onRtcp(const char *buf, size_t len) {
sendRtcpPacket(buf, len, true, nullptr); 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";
}
}
}
}

View File

@ -22,6 +22,7 @@ public:
protected: protected:
///////WebRtcTransportImp override/////// ///////WebRtcTransportImp override///////
void onRtcConfigure(RtcConfigure &configure) const override; void onRtcConfigure(RtcConfigure &configure) const override;
void onCheckSdp(SdpType type, RtcSession &sdp) override;
void onRtp(const char *buf, size_t len, uint64_t stamp_ms) override; void onRtp(const char *buf, size_t len, uint64_t stamp_ms) override;
void onRtcp(const char *buf, size_t len) override; void onRtcp(const char *buf, size_t len) override;