提交 9621f000 authored 作者: José Luis Millán's avatar José Luis Millán

Rtcp: avoid sending receiver reports too frequently

上级 24e2eca4
...@@ -516,6 +516,7 @@ namespace RTC ...@@ -516,6 +516,7 @@ namespace RTC
for (auto it = this->transports.begin(); it != this->transports.end(); ++it) for (auto it = this->transports.begin(); it != this->transports.end(); ++it)
{ {
RTC::RTCP::CompoundPacket packet; RTC::RTCP::CompoundPacket packet;
RTC::Transport* transport = it->second; RTC::Transport* transport = it->second;
for (auto it = this->rtpSenders.begin(); it != this->rtpSenders.end(); ++it) for (auto it = this->rtpSenders.begin(); it != this->rtpSenders.end(); ++it)
...@@ -527,7 +528,6 @@ namespace RTC ...@@ -527,7 +528,6 @@ namespace RTC
RTC::RTCP::SenderReport* report = rtpSender->GetRtcpSenderReport(); RTC::RTCP::SenderReport* report = rtpSender->GetRtcpSenderReport();
// TODO: Get next rtpSender data on next SendRtcp() call.
if (report) if (report)
{ {
packet.AddSenderReport(report); packet.AddSenderReport(report);
...@@ -540,6 +540,10 @@ namespace RTC ...@@ -540,6 +540,10 @@ namespace RTC
} }
} }
// TMP: only send RR if SR is also being sent.
if (packet.GetSenderReportCount() == 0)
return;
for (auto it = this->rtpReceivers.begin(); it != this->rtpReceivers.end(); ++it) for (auto it = this->rtpReceivers.begin(); it != this->rtpReceivers.end(); ++it)
{ {
RTC::RtpReceiver* rtpReceiver = it->second; RTC::RtpReceiver* rtpReceiver = it->second;
...@@ -553,8 +557,6 @@ namespace RTC ...@@ -553,8 +557,6 @@ namespace RTC
packet.AddReceiverReport(report); packet.AddReceiverReport(report);
} }
if (packet.GetSenderReportCount() || packet.GetReceiverReportCount())
{
// Ensure that the RTCP packet fits into the RTCP buffer. // Ensure that the RTCP packet fits into the RTCP buffer.
if (packet.GetSize() > MS_RTCP_BUFFER_SIZE) if (packet.GetSize() > MS_RTCP_BUFFER_SIZE)
{ {
...@@ -566,7 +568,6 @@ namespace RTC ...@@ -566,7 +568,6 @@ namespace RTC
transport->SendRtcpCompoundPacket(&packet); transport->SendRtcpCompoundPacket(&packet);
} }
} }
}
RTC::Transport* Peer::GetTransportFromRequest(Channel::Request* request, uint32_t* transportId) RTC::Transport* Peer::GetTransportFromRequest(Channel::Request* request, uint32_t* transportId)
{ {
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论