Commit e81d9198 by xia-chu

完善sdp对ssrc的处理

parent 26762b6a
......@@ -46,3 +46,4 @@
/3rdpart/media-server/.idea/
/ios/
/cmake-build-*
/3rdpart/ZLToolKit/cmake-build-mq/
......@@ -414,17 +414,7 @@ public:
//a=ssrc-group:SIM 360918977 360918978 360918980
// 在 Chrome 独有的 SDP munging 风格的 simulcast 中使用,将三组编码质量由低到高的 MediaStreamTrack 关联在一起。
string type{"FID"};
union {
struct {
uint32_t rtp_ssrc;
uint32_t rtx_ssrc;
} fid;
struct {
uint32_t rtp_ssrc_low;
uint32_t rtp_ssrc_mid;
uint32_t rtp_ssrc_high;
} sim;
} u;
vector<uint32_t> ssrcs;
bool isFID() const { return type == "FID"; }
bool isSIM() const { return type == "SIM"; }
......@@ -480,8 +470,16 @@ public:
class SdpAttrSimulcast : public SdpItem{
public:
//todo
//https://www.meetecho.com/blog/simulcast-janus-ssrc/
//https://tools.ietf.org/html/draft-ietf-mmusic-sdp-simulcast-14
const char* getKey() const override { return "simulcast";}
void parse(const string &str) override;
string toString() const override;
string direction;
string rid0;
string rid1;
string rid2;
};
class SdpAttrRid : public SdpItem{
......@@ -610,13 +608,10 @@ public:
vector<RtcCodecPlan> plan;
//////// rtp ////////
RtcSSRC rtp_ssrc;
RtcSSRC rtx_ssrc;
vector<RtcSSRC> rtp_rtx_ssrc;
//////// simulcast ////////
RtcSSRC rtp_ssrc_low;
RtcSSRC rtp_ssrc_mid;
RtcSSRC rtp_ssrc_high;
vector<RtcSSRC> rtp_ssrc_sim;
//////// rtcp ////////
bool rtcp_mux{false};
......
......@@ -401,7 +401,7 @@ void WebRtcTransportImp::onStartWebRTC() {
}
//获取offer端rtp的ssrc和pt相关信息
auto &ref = _rtp_info_pt[plan.pt];
_rtp_info_ssrc[m.rtp_ssrc.ssrc] = &ref;
_rtp_info_ssrc[m.rtp_rtx_ssrc[0].ssrc] = &ref;
ref.plan = &plan;
ref.media = &m;
ref.is_common_rtp = getCodecId(plan.codec) != CodecInvalid;
......@@ -482,16 +482,17 @@ void WebRtcTransportImp::onCheckSdp(SdpType type, RtcSession &sdp){
continue;
}
//添加answer sdp的ssrc信息
m.rtp_ssrc.ssrc = _play_src->getSsrc(m.type);
m.rtp_ssrc.cname = RTP_CNAME;
m.rtp_ssrc.label = RTP_LABEL;
m.rtp_ssrc.mslabel = RTP_MSLABEL;
m.rtp_ssrc.msid = RTP_MSID;
m.rtp_rtx_ssrc.emplace_back();
m.rtp_rtx_ssrc[0].ssrc = _play_src->getSsrc(m.type);
m.rtp_rtx_ssrc[0].cname = RTP_CNAME;
m.rtp_rtx_ssrc[0].label = RTP_LABEL;
m.rtp_rtx_ssrc[0].mslabel = RTP_MSLABEL;
m.rtp_rtx_ssrc[0].msid = RTP_MSID;
//todo 先屏蔽rtx,因为chrome报错
if (m.getRelatedRtxPlan(m.plan[0].pt)) {
m.rtx_ssrc = m.rtp_ssrc;
m.rtx_ssrc.ssrc += RTX_SSRC_OFFSET;
m.rtp_rtx_ssrc.emplace_back();
m.rtp_rtx_ssrc[1] = m.rtp_rtx_ssrc[0];
m.rtp_rtx_ssrc[1].ssrc += RTX_SSRC_OFFSET;
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论