Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc

Issue 2988763002: Take smaller interface for RtpRtcp::Configuration::receive_statistics (Closed)
Patch Set: rerenaming Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
index 84231e5a57fd649f2609402e722b91bdd478c73b..be78a4320ff1b3906f4faea0015b6366aa23fa47 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -139,7 +139,7 @@ class RTCPSender::RtcpContext {
RTCPSender::RTCPSender(
bool audio,
Clock* clock,
- ReceiveStatistics* receive_statistics,
+ ReceiveStatisticsProvider* receive_statistics,
RtcpPacketTypeCounterObserver* packet_type_counter_observer,
RtcEventLog* event_log,
Transport* outgoing_transport)
@@ -836,32 +836,10 @@ std::vector<rtcp::ReportBlock> RTCPSender::CreateReportBlocks(
if (!receive_statistics_)
return result;
- StatisticianMap statisticians = receive_statistics_->GetActiveStatisticians();
- result.reserve(statisticians.size());
- for (auto& statistician : statisticians) {
- // Do we have receive statistics to send?
- RtcpStatistics stats;
- if (!statistician.second->GetStatistics(&stats, true))
- continue;
- // TODO(danilchap): Support sending more than |RTCP_MAX_REPORT_BLOCKS| per
- // compound rtcp packet when single rtcp module is used for multiple media
- // streams.
- if (result.size() >= RTCP_MAX_REPORT_BLOCKS) {
- LOG(LS_WARNING) << "Too many report blocks.";
- continue;
- }
- result.emplace_back();
- rtcp::ReportBlock& block = result.back();
- block.SetMediaSsrc(statistician.first);
- block.SetFractionLost(stats.fraction_lost);
- if (!block.SetCumulativeLost(stats.cumulative_lost)) {
- LOG(LS_WARNING) << "Cumulative lost is oversized.";
- result.pop_back();
- continue;
- }
- block.SetExtHighestSeqNum(stats.extended_max_sequence_number);
- block.SetJitter(stats.jitter);
- }
+ // TODO(danilchap): Support sending more than |RTCP_MAX_REPORT_BLOCKS| per
+ // compound rtcp packet when single rtcp module is used for multiple media
+ // streams.
+ result = receive_statistics_->RtcpReportBlocks(RTCP_MAX_REPORT_BLOCKS);
eladalon 2017/07/27 09:07:31 nit: Consider not passing this RFC-defined constan
danilchap 2017/07/27 10:04:32 I did that initially, but then introduce this para
eladalon 2017/07/27 10:40:18 Acknowledged.
if (!result.empty() && ((feedback_state.last_rr_ntp_secs != 0) ||
(feedback_state.last_rr_ntp_frac != 0))) {

Powered by Google App Engine
This is Rietveld 408576698