完善sdp提取

This commit is contained in:
ziyue 2021-03-29 18:31:56 +08:00
parent 9d2498a694
commit 62036d0f5d
2 changed files with 14 additions and 3 deletions

View File

@ -897,6 +897,17 @@ void RtcSession::loadFrom(const string &str) {
RtcMedia rtc_media; RtcMedia rtc_media;
rtc_media.type = mline.type; rtc_media.type = mline.type;
rtc_media.mid = media.getStringItem('a', "mid"); rtc_media.mid = media.getStringItem('a', "mid");
rtc_media.proto = mline.proto;
rtc_media.type = mline.type;
rtc_media.port = mline.port;
rtc_media.direction = media.getDirection();
rtc_media.rtp_addr = media.getItemClass<SdpConnection>('c');
rtc_media.rtcp_addr = media.getItemClass<SdpAttrRtcp>('a',"rtcp");
rtc_media.ice_ufrag = media.getStringItem('a',"ice-ufrag");
rtc_media.ice_ufrag = media.getStringItem('a',"ice-pwd");
rtc_media.fingerprint = media.getItemClass<SdpAttrFingerprint>('a', "fingerprint");
rtc_media.role = media.getItemClass<SdpAttrSetup>('a',"setup").role;
// rtc_media.rtcp_mux =
} }
} }

View File

@ -494,7 +494,7 @@ public:
}; };
//rtc传输编码方案 //rtc传输编码方案
class RtcPlan{ class RtcCodecPlan{
public: public:
uint8_t pt; uint8_t pt;
string codec; string codec;
@ -514,10 +514,10 @@ public:
string proto; string proto;
//////// rtp //////// //////// rtp ////////
vector<RtcPlan> plan; RtcSSRC ssrc;
SdpConnection rtp_addr; SdpConnection rtp_addr;
RtpDirection direction; RtpDirection direction;
RtcSSRC ssrc; vector<RtcCodecPlan> plan;
//////// rtx - rtcp //////// //////// rtx - rtcp ////////
bool rtcp_mux; bool rtcp_mux;