mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-12-03 04:30:15 +08:00
提前映射ssrc与rid的关系
This commit is contained in:
parent
0f1d1ded7e
commit
8c670c652e
@ -579,6 +579,10 @@ string RtpExtContext::getRid(uint32_t ssrc) const{
|
||||
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) {
|
||||
string rid, repaired_rid;
|
||||
auto ext_map = RtpExt::getExtValue(header);
|
||||
|
@ -119,6 +119,7 @@ public:
|
||||
|
||||
void setOnGetRtp(OnGetRtp cb);
|
||||
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);
|
||||
|
||||
private:
|
||||
|
@ -432,6 +432,17 @@ void WebRtcTransportImp::onStartWebRTC() {
|
||||
_ssrc_to_track[ssrc] = track;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user