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

Unified Diff: webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.cc

Issue 2917873002: Refactored incoming bitrate estimator. (Closed)
Patch Set: Respond to comments Created 3 years, 6 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/congestion_controller/delay_based_bwe_unittest_helper.cc
diff --git a/webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.cc b/webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.cc
index 479ecb457b30b19f7cb4a02475ad19f1bcad6f17..62c9f881bc1ef1e92213efc871e6013bc2eddc6c 100644
--- a/webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.cc
+++ b/webrtc/modules/congestion_controller/delay_based_bwe_unittest_helper.cc
@@ -14,6 +14,7 @@
#include <utility>
#include "webrtc/base/checks.h"
+#include "webrtc/base/ptr_util.h"
#include "webrtc/modules/congestion_controller/delay_based_bwe.h"
namespace webrtc {
@@ -149,6 +150,8 @@ int64_t StreamGenerator::GenerateFrame(std::vector<PacketFeedback>* packets,
DelayBasedBweTest::DelayBasedBweTest()
: clock_(100000000),
+ acknowledged_bitrate_estimator_(
+ rtc::MakeUnique<AcknowledgedBitrateEstimator>()),
bitrate_estimator_(new DelayBasedBwe(nullptr, &clock_)),
stream_generator_(new test::StreamGenerator(1e6, // Capacity.
clock_.TimeInMicroseconds())),
@@ -181,8 +184,10 @@ void DelayBasedBweTest::IncomingFeedback(int64_t arrival_time_ms,
sequence_number, payload_size, pacing_info);
std::vector<PacketFeedback> packets;
packets.push_back(packet);
+ acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector(packets);
DelayBasedBwe::Result result =
- bitrate_estimator_->IncomingPacketFeedbackVector(packets);
+ bitrate_estimator_->IncomingPacketFeedbackVector(
+ packets, acknowledged_bitrate_estimator_->bitrate_bps());
const uint32_t kDummySsrc = 0;
if (result.updated) {
bitrate_observer_.OnReceiveBitrateChanged({kDummySsrc},
@@ -213,8 +218,11 @@ bool DelayBasedBweTest::GenerateAndProcessFrame(uint32_t ssrc,
RTC_CHECK_GE(packet.arrival_time_ms + arrival_time_offset_ms_, 0);
packet.arrival_time_ms += arrival_time_offset_ms_;
}
+
+ acknowledged_bitrate_estimator_->IncomingPacketFeedbackVector(packets);
DelayBasedBwe::Result result =
- bitrate_estimator_->IncomingPacketFeedbackVector(packets);
+ bitrate_estimator_->IncomingPacketFeedbackVector(
+ packets, acknowledged_bitrate_estimator_->bitrate_bps());
const uint32_t kDummySsrc = 0;
if (result.updated) {
bitrate_observer_.OnReceiveBitrateChanged({kDummySsrc},

Powered by Google App Engine
This is Rietveld 408576698