添加ssrc相关方法

This commit is contained in:
xiongziliang 2021-05-16 12:28:50 +08:00
parent d395d23eeb
commit f6eb84b413
2 changed files with 16 additions and 0 deletions

View File

@ -1284,6 +1284,20 @@ const RtcCodecPlan *RtcMedia::getRelatedRtxPlan(uint8_t pt) const{
return nullptr; return nullptr;
} }
uint32_t RtcMedia::getRtpSSRC() const {
if (rtp_rtx_ssrc.size()) {
return rtp_rtx_ssrc[0].ssrc;
}
return 0;
}
uint32_t RtcMedia::getRtxSSRC() const {
if (rtp_rtx_ssrc.size() > 1) {
return rtp_rtx_ssrc[1].ssrc;
}
return 0;
}
void RtcMedia::checkValid() const{ void RtcMedia::checkValid() const{
CHECK(type != TrackInvalid); CHECK(type != TrackInvalid);
CHECK(!mid.empty()); CHECK(!mid.empty());

View File

@ -645,6 +645,8 @@ public:
const RtcCodecPlan *getPlan(uint8_t pt) const; const RtcCodecPlan *getPlan(uint8_t pt) const;
const RtcCodecPlan *getPlan(const char *codec) const; const RtcCodecPlan *getPlan(const char *codec) const;
const RtcCodecPlan *getRelatedRtxPlan(uint8_t pt) const; const RtcCodecPlan *getRelatedRtxPlan(uint8_t pt) const;
uint32_t getRtpSSRC() const;
uint32_t getRtxSSRC() const;
}; };
class RtcSession{ class RtcSession{