From 7eb938d4c065014a6d33a4258b6e85e28de28359 Mon Sep 17 00:00:00 2001 From: danilchap Date: Tue, 5 Sep 2017 04:02:11 -0700 Subject: [PATCH] In bwe tests Collect receive statistic using GetReportBlocks collector instead of GetActiveStatistcian BUG=webrtc:8016 Review-Url: https://codereview.webrtc.org/2996883002 Cr-Commit-Position: refs/heads/master@{#19685} --- .../test/estimators/remb.cc | 25 ++++++------------- .../test/estimators/remb.h | 1 - 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.cc b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.cc index 1daf14e51e..c3f1dc98e4 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.cc @@ -110,10 +110,14 @@ FeedbackPacket* RembReceiver::GetFeedback(int64_t now_ms) { uint32_t estimated_bps = 0; RembFeedback* feedback = NULL; if (LatestEstimate(&estimated_bps)) { - StatisticianMap statisticians = recv_stats_->GetActiveStatisticians(); - RTCPReportBlock report_block; - if (!statisticians.empty()) { - latest_report_block_ = BuildReportBlock(statisticians.begin()->second); + auto report_blocks = recv_stats_->RtcpReportBlocks(1); + if (!report_blocks.empty()) { + const rtcp::ReportBlock& stat = report_blocks.front(); + latest_report_block_.fraction_lost = stat.fraction_lost(); + latest_report_block_.packets_lost = stat.cumulative_lost(); + latest_report_block_.extended_highest_sequence_number = + stat.extended_high_seq_num(); + latest_report_block_.jitter = stat.jitter(); } feedback = new RembFeedback(flow_id_, now_ms * 1000, last_feedback_ms_, @@ -133,19 +137,6 @@ FeedbackPacket* RembReceiver::GetFeedback(int64_t now_ms) { void RembReceiver::OnReceiveBitrateChanged(const std::vector& ssrcs, uint32_t bitrate) {} -RTCPReportBlock RembReceiver::BuildReportBlock( - StreamStatistician* statistician) { - RTCPReportBlock report_block; - RtcpStatistics stats; - RTC_DCHECK(statistician->GetStatistics(&stats, true)); - report_block.fraction_lost = stats.fraction_lost; - report_block.packets_lost = stats.packets_lost; - report_block.extended_highest_sequence_number = - stats.extended_highest_sequence_number; - report_block.jitter = stats.jitter; - return report_block; -} - bool RembReceiver::LatestEstimate(uint32_t* estimate_bps) { if (latest_estimate_bps_ < 0) { std::vector ssrcs; diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h index 841f79e419..77086a761e 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h @@ -66,7 +66,6 @@ class RembReceiver : public BweReceiver, public RemoteBitrateObserver { uint32_t bitrate) override; private: - static RTCPReportBlock BuildReportBlock(StreamStatistician* statistician); bool LatestEstimate(uint32_t* estimate_bps); std::string estimate_log_prefix_;