Unverified 提交 bb4db2be authored 作者: José Luis Millán's avatar José Luis Millán 提交者: GitHub

Transport.cpp: provide transport congestion client with RTCP Receiver… (#464)

* Transport.cpp: provide transport congestion client with RTCP Receiver Reports

* Transport.cpp: remove invalid comment

* Transport.cpp: retrieve RTT from the first active consumer
上级 de1a44df
...@@ -63,7 +63,7 @@ namespace RTC ...@@ -63,7 +63,7 @@ namespace RTC
webrtc::PacedPacketInfo GetPacingInfo(); webrtc::PacedPacketInfo GetPacingInfo();
void PacketSent(webrtc::RtpPacketSendInfo& packetInfo, int64_t nowMs); void PacketSent(webrtc::RtpPacketSendInfo& packetInfo, int64_t nowMs);
void ReceiveEstimatedBitrate(uint32_t bitrate); void ReceiveEstimatedBitrate(uint32_t bitrate);
void ReceiveRtcpReceiverReport(const webrtc::RTCPReportBlock& report, float rtt, int64_t nowMs); void ReceiveRtcpReceiverReport(RTC::RTCP::ReceiverReportPacket* packet, float rtt, int64_t nowMs);
void ReceiveRtcpTransportFeedback(const RTC::RTCP::FeedbackRtpTransportPacket* feedback); void ReceiveRtcpTransportFeedback(const RTC::RTCP::FeedbackRtpTransportPacket* feedback);
void SetDesiredBitrate(uint32_t desiredBitrate, bool force); void SetDesiredBitrate(uint32_t desiredBitrate, bool force);
const Bitrates& GetBitrates() const const Bitrates& GetBitrates() const
......
...@@ -1886,23 +1886,6 @@ namespace RTC ...@@ -1886,23 +1886,6 @@ namespace RTC
// Special case for the RTP probator. // Special case for the RTP probator.
if (report->GetSsrc() == RTC::RtpProbationSsrc) if (report->GetSsrc() == RTC::RtpProbationSsrc)
{ {
// TODO: We should pass the RR to the tccClient (and in fact just RR for the
// probation stream).
// TODO: Convert report to ReportBlock and pass to tccClient.
// RTCPReportBlock in libwebrtc/libwebrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h
//
// NOTE: consumer->GetRtt() is already implemented.
//
// NOTE: Better pass our RR to the tccClient and convert there to webrtc
// class.
//
// if (this->tccClient)
// {
// this->tccClient->ReceiveRtcpReceiverReport(report, consumer->GetRtt(),
// DepLibUV::GetTimeMsInt64());
// }
continue; continue;
} }
...@@ -1917,6 +1900,26 @@ namespace RTC ...@@ -1917,6 +1900,26 @@ namespace RTC
consumer->ReceiveRtcpReceiverReport(report); consumer->ReceiveRtcpReceiverReport(report);
} }
if (this->tccClient && !this->mapConsumers.empty())
{
float rtt = 0;
// Retrieve the RTT from the first active consumer.
for (auto& kv : this->mapConsumers)
{
auto* consumer = kv.second;
if (consumer->IsActive())
{
rtt = consumer->GetRtt();
break;
}
}
this->tccClient->ReceiveRtcpReceiverReport(rr, rtt, DepLibUV::GetTimeMsInt64());
}
break; break;
} }
......
...@@ -29,7 +29,8 @@ namespace RTC ...@@ -29,7 +29,8 @@ namespace RTC
webrtc::GoogCcFactoryConfig config; webrtc::GoogCcFactoryConfig config;
config.feedback_only = bweType == RTC::BweType::TRANSPORT_CC; // Provide RTCP feedback as well as Receiver Reports.
config.feedback_only = false;
this->controllerFactory = new webrtc::GoogCcNetworkControllerFactory(std::move(config)); this->controllerFactory = new webrtc::GoogCcNetworkControllerFactory(std::move(config));
...@@ -129,12 +130,29 @@ namespace RTC ...@@ -129,12 +130,29 @@ namespace RTC
} }
void TransportCongestionControlClient::ReceiveRtcpReceiverReport( void TransportCongestionControlClient::ReceiveRtcpReceiverReport(
const webrtc::RTCPReportBlock& report, float rtt, int64_t nowMs) RTC::RTCP::ReceiverReportPacket* packet, float rtt, int64_t nowMs)
{ {
MS_TRACE(); MS_TRACE();
webrtc::ReportBlockList reportBlockList;
for (auto it = packet->Begin(); it != packet->End(); ++it)
{
auto& report = *it;
reportBlockList.emplace_back(
packet->GetSsrc(),
report->GetSsrc(),
report->GetFractionLost(),
report->GetTotalLost(),
report->GetLastSeq(),
report->GetJitter(),
report->GetLastSenderReport(),
report->GetDelaySinceLastSenderReport());
}
this->rtpTransportControllerSend->OnReceivedRtcpReceiverReport( this->rtpTransportControllerSend->OnReceivedRtcpReceiverReport(
{ report }, static_cast<int64_t>(rtt), nowMs); reportBlockList, static_cast<int64_t>(rtt), nowMs);
} }
void TransportCongestionControlClient::ReceiveRtcpTransportFeedback( void TransportCongestionControlClient::ReceiveRtcpTransportFeedback(
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论