Commit 8c670c65 by ziyue

提前映射ssrc与rid的关系

parent 0f1d1ded
...@@ -579,6 +579,10 @@ string RtpExtContext::getRid(uint32_t ssrc) const{ ...@@ -579,6 +579,10 @@ string RtpExtContext::getRid(uint32_t ssrc) const{
return it->second; return it->second;
} }
void RtpExtContext::setRid(uint32_t ssrc, const string &rid) {
_ssrc_to_rid[ssrc] = rid;
}
void RtpExtContext::changeRtpExtId(const RtpHeader *header, bool is_recv, string *rid_ptr) { void RtpExtContext::changeRtpExtId(const RtpHeader *header, bool is_recv, string *rid_ptr) {
string rid, repaired_rid; string rid, repaired_rid;
auto ext_map = RtpExt::getExtValue(header); auto ext_map = RtpExt::getExtValue(header);
......
...@@ -119,6 +119,7 @@ public: ...@@ -119,6 +119,7 @@ public:
void setOnGetRtp(OnGetRtp cb); void setOnGetRtp(OnGetRtp cb);
string getRid(uint32_t ssrc) const; string getRid(uint32_t ssrc) const;
void setRid(uint32_t ssrc, const string &rid);
void changeRtpExtId(const RtpHeader *header, bool is_recv, string *rid_ptr = nullptr); void changeRtpExtId(const RtpHeader *header, bool is_recv, string *rid_ptr = nullptr);
private: private:
......
...@@ -432,6 +432,17 @@ void WebRtcTransportImp::onStartWebRTC() { ...@@ -432,6 +432,17 @@ void WebRtcTransportImp::onStartWebRTC() {
_ssrc_to_track[ssrc] = track; _ssrc_to_track[ssrc] = track;
InfoL << "get rtp, pt:" << (int) pt << ", ssrc:" << ssrc << ", rid:" << rid; InfoL << "get rtp, pt:" << (int) pt << ", ssrc:" << ssrc << ", rid:" << rid;
}); });
int index = 0;
for (auto &ssrc : m_offer->rtp_ssrc_sim) {
//记录ssrc对应的MediaTrack
_ssrc_to_track[ssrc.ssrc] = track;
if (m_offer->rtp_rids.size() > index) {
//支持firefox的simulcast, 提前映射好ssrc和rid的关系
track->rtp_ext_ctx->setRid(ssrc.ssrc, m_offer->rtp_rids[index]);
}
++index;
}
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论