过滤掉不支持的webrtc rtp ext,提高webrtc转发兼容性

在测试obs simulcast推流时,发现chrome无法正常播放,
分析rtp ext扩展,发现是rtp mid ext未过滤导致,
zlmediakit在回复answer sdp时,已申明不支持mid扩展,
但是obs并未理会还是发送mid扩展。
根据answer sdp过滤rtp ext可兼容此问题。
This commit is contained in:
xia-chu 2023-08-12 15:24:20 +08:00
parent 2378617dd8
commit a7d95461ee

View File

@ -515,7 +515,7 @@ void WebRtcTransportImp::onStartWebRTC() {
_pt_to_track.emplace(track->plan_rtx->pt, std::unique_ptr<WrappedMediaTrack>(new WrappedRtxTrack(track))); _pt_to_track.emplace(track->plan_rtx->pt, std::unique_ptr<WrappedMediaTrack>(new WrappedRtxTrack(track)));
} }
// 记录rtp ext类型与id的关系方便接收或发送rtp时修改rtp ext id // 记录rtp ext类型与id的关系方便接收或发送rtp时修改rtp ext id
track->rtp_ext_ctx = std::make_shared<RtpExtContext>(*m_offer); track->rtp_ext_ctx = std::make_shared<RtpExtContext>(m_answer);
weak_ptr<MediaTrack> weak_track = track; weak_ptr<MediaTrack> weak_track = track;
track->rtp_ext_ctx->setOnGetRtp([this, weak_track](uint8_t pt, uint32_t ssrc, const string &rid) { track->rtp_ext_ctx->setOnGetRtp([this, weak_track](uint8_t pt, uint32_t ssrc, const string &rid) {
// ssrc --> MediaTrack // ssrc --> MediaTrack