提交 452d116a authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Remove unsupported RTCP feedback items from the peer's capabilities.

上级 3d2e200a
...@@ -142,6 +142,7 @@ namespace RTC ...@@ -142,6 +142,7 @@ namespace RTC
Json::Value toJson(); Json::Value toJson();
bool Matches(RtpCodecParameters& codec, bool checkPayloadType = false); bool Matches(RtpCodecParameters& codec, bool checkPayloadType = false);
void RemoveUnsupportedRtcpFeedback(std::vector<RtcpFeedback>& supportedRtcpFeedback);
private: private:
void CheckCodec(); void CheckCodec();
......
...@@ -470,7 +470,12 @@ namespace RTC ...@@ -470,7 +470,12 @@ namespace RTC
auto& roomCodecCapability = *it2; auto& roomCodecCapability = *it2;
if (roomCodecCapability.Matches(peerCodecCapability)) if (roomCodecCapability.Matches(peerCodecCapability))
{
// Once matched, remove the unsupported RTCP feedback from the given codec.
peerCodecCapability.RemoveUnsupportedRtcpFeedback(roomCodecCapability.rtcpFeedback);
break; break;
}
} }
if (it2 != this->capabilities.codecs.end()) if (it2 != this->capabilities.codecs.end())
......
...@@ -225,6 +225,30 @@ namespace RTC ...@@ -225,6 +225,30 @@ namespace RTC
return true; return true;
} }
void RtpCodecParameters::RemoveUnsupportedRtcpFeedback(std::vector<RtcpFeedback>& supportedRtcpFeedback)
{
MS_TRACE();
std::vector<RtcpFeedback> updatedRtcpFeedback;
for (auto& rtcpFeedbackItem : this->rtcpFeedback)
{
for (auto& supportedRtcpFeedbackItem : supportedRtcpFeedback)
{
if (
rtcpFeedbackItem.type == supportedRtcpFeedbackItem.type &&
rtcpFeedbackItem.parameter == supportedRtcpFeedbackItem.parameter)
{
updatedRtcpFeedback.push_back(supportedRtcpFeedbackItem);
break;
}
}
}
this->rtcpFeedback = updatedRtcpFeedback;
}
inline inline
void RtpCodecParameters::CheckCodec() void RtpCodecParameters::CheckCodec()
{ {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论