添加ssrc相关的方法

This commit is contained in:
xia-chu
2021-05-10 17:35:22 +08:00
parent 985fe310b6
commit d4ce5b0091
2 changed files with 23 additions and 0 deletions

View File

@@ -1290,6 +1290,9 @@ void RtcMedia::checkValid() const{
CHECK(!proto.empty());
CHECK(direction != RtpDirection::invalid || type == TrackApplication);
CHECK(!plan.empty() || type == TrackApplication );
}
void RtcMedia::checkValidSSRC() const {
bool send_rtp = (direction == RtpDirection::sendonly || direction == RtpDirection::sendrecv);
if (rtp_rids.empty() && rtp_ssrc_sim.empty()) {
//非simulcast时检查有没有指定rtp ssrc
@@ -1318,6 +1321,12 @@ void RtcSession::checkValid() const{
}
}
void RtcSession::checkValidSSRC() const{
for (auto &item : media) {
item.checkValidSSRC();
}
}
const RtcMedia *RtcSession::getMedia(TrackType type) const{
for(auto &m : media){
if(m.type == type){
@@ -1327,6 +1336,15 @@ const RtcMedia *RtcSession::getMedia(TrackType type) const{
return nullptr;
}
bool RtcSession::haveSSRC() const {
for (auto &m : media) {
if (!m.rtp_rtx_ssrc.empty()) {
return true;
}
}
return false;
}
bool RtcSession::supportRtcpFb(const string &name, TrackType type) const {
auto media = getMedia(type);
if (!media) {