重写webrtc sdp校验逻辑,确保无有效track时抛异常:#1157

This commit is contained in:
ziyue
2021-10-16 16:46:05 +08:00
parent b10fc52384
commit 9433a0c383
3 changed files with 53 additions and 143 deletions

View File

@@ -641,8 +641,6 @@ public:
uint32_t sctp_port{0};
void checkValid() const;
//offer sdp,如果指定了发送rtp,那么应该指定ssrc
void checkValidSSRC() const;
const RtcCodecPlan *getPlan(uint8_t pt) const;
const RtcCodecPlan *getPlan(const char *codec) const;
const RtcCodecPlan *getRelatedRtxPlan(uint8_t pt) const;
@@ -651,7 +649,7 @@ public:
bool supportSimulcast() const;
};
class RtcSession{
class RtcSession {
public:
using Ptr = std::shared_ptr<RtcSession>;
@@ -666,15 +664,11 @@ public:
vector<RtcMedia> media;
SdpAttrGroup group;
void loadFrom(const string &sdp, bool check = true);
void loadFrom(const string &sdp);
void checkValid() const;
void checkSdp() const;
//offer sdp,如果指定了发送rtp,那么应该指定ssrc
void checkValidSSRC() const;
string toString() const;
string toRtspSdp() const;
const RtcMedia *getMedia(TrackType type) const;
bool haveSSRC() const;
bool supportRtcpFb(const string &name, TrackType type = TrackType::TrackVideo) const;
bool supportSimulcast() const;