Revert "Moved congestion controller to task queue."

This reverts commit 0cbcba7ea0dced1a7f353c64d6cf91d46ccb29f9.

Reason for revert: Major regressions on perf bots.

Original change's description:
> Moved congestion controller to task queue.
> 
> The goal of this work is to make it easier to experiment with the
> bandwidth estimation implementation. For this reason network control
> functionality is moved from SendSideCongestionController(SSCC),
> PacedSender and BitrateController to the newly created
> GoogCcNetworkController which implements the newly created
> NetworkControllerInterface. This allows the implementation to be
> replaced at runtime in the future.
> 
> This is the first part of a split of a larger CL, see:
> https://webrtc-review.googlesource.com/c/src/+/39788/8
> For further explanations.
> 
> Bug: webrtc:8415
> Change-Id: I770189c04cc31b313bd4e57821acff55fbcb1ad3
> Reviewed-on: https://webrtc-review.googlesource.com/43840
> Commit-Queue: Sebastian Jansson <srte@webrtc.org>
> Reviewed-by: Björn Terelius <terelius@webrtc.org>
> Reviewed-by: Stefan Holmer <stefan@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#21868}

TBR=terelius@webrtc.org,stefan@webrtc.org,srte@webrtc.org

Change-Id: Ia8a273eb9e92b7d0d960c49658c228208170962d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:8415
Reviewed-on: https://webrtc-review.googlesource.com/47560
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21877}
This commit is contained in:
Sebastian Jansson
2018-02-02 16:55:07 +00:00
committed by Commit Bot
parent c5017136c7
commit 5a503b05e1
57 changed files with 837 additions and 2996 deletions

View File

@ -85,8 +85,9 @@ DelayBasedBwe::Result::Result(bool probe, uint32_t target_bitrate_bps)
DelayBasedBwe::Result::~Result() {}
DelayBasedBwe::DelayBasedBwe(RtcEventLog* event_log)
DelayBasedBwe::DelayBasedBwe(RtcEventLog* event_log, const Clock* clock)
: event_log_(event_log),
clock_(clock),
inter_arrival_(),
delay_detector_(),
last_seen_packet_ms_(-1),
@ -113,8 +114,7 @@ DelayBasedBwe::~DelayBasedBwe() {}
DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector(
const std::vector<PacketFeedback>& packet_feedback_vector,
rtc::Optional<uint32_t> acked_bitrate_bps,
int64_t at_time_ms) {
rtc::Optional<uint32_t> acked_bitrate_bps) {
RTC_DCHECK(std::is_sorted(packet_feedback_vector.begin(),
packet_feedback_vector.end(),
PacketFeedbackComparator()));
@ -141,7 +141,7 @@ DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector(
if (packet_feedback.send_time_ms < 0)
continue;
delayed_feedback = false;
IncomingPacketFeedback(packet_feedback, at_time_ms);
IncomingPacketFeedback(packet_feedback);
if (prev_detector_state == BandwidthUsage::kBwUnderusing &&
delay_detector_->State() == BandwidthUsage::kBwNormal) {
recovered_from_overuse = true;
@ -157,8 +157,7 @@ DelayBasedBwe::Result DelayBasedBwe::IncomingPacketFeedbackVector(
}
} else {
consecutive_delayed_feedbacks_ = 0;
return MaybeUpdateEstimate(acked_bitrate_bps, recovered_from_overuse,
at_time_ms);
return MaybeUpdateEstimate(acked_bitrate_bps, recovered_from_overuse);
}
return Result();
}
@ -181,9 +180,8 @@ DelayBasedBwe::Result DelayBasedBwe::OnLongFeedbackDelay(
}
void DelayBasedBwe::IncomingPacketFeedback(
const PacketFeedback& packet_feedback,
int64_t at_time_ms) {
int64_t now_ms = at_time_ms;
const PacketFeedback& packet_feedback) {
int64_t now_ms = clock_->TimeInMilliseconds();
// Reset if the stream has timed out.
if (last_seen_packet_ms_ == -1 ||
now_ms - last_seen_packet_ms_ > kStreamTimeOutMs) {
@ -225,10 +223,9 @@ void DelayBasedBwe::IncomingPacketFeedback(
DelayBasedBwe::Result DelayBasedBwe::MaybeUpdateEstimate(
rtc::Optional<uint32_t> acked_bitrate_bps,
bool recovered_from_overuse,
int64_t at_time_ms) {
bool recovered_from_overuse) {
Result result;
int64_t now_ms = at_time_ms;
int64_t now_ms = clock_->TimeInMilliseconds();
rtc::Optional<int> probe_bitrate_bps =
probe_bitrate_estimator_.FetchAndResetLastEstimatedBitrateBps();
@ -292,7 +289,7 @@ bool DelayBasedBwe::UpdateEstimate(int64_t now_ms,
return rate_control_.ValidEstimate();
}
void DelayBasedBwe::OnRttUpdate(int64_t avg_rtt_ms) {
void DelayBasedBwe::OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) {
rate_control_.SetRtt(avg_rtt_ms);
}