Adds interface for remote network estimates to NetworkControllerInterface.
Bug: webrtc:10742 Change-Id: I593fc17ce5d42c5dc17fd289f0621230319f9752 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/144039 Commit-Queue: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Björn Terelius <terelius@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28405}
This commit is contained in:
committed by
Commit Bot
parent
2efae7786e
commit
49167de0be
@ -253,10 +253,9 @@ NetworkControlUpdate GoogCcNetworkController::OnSentPacket(
|
||||
}
|
||||
bandwidth_estimation_->OnSentPacket(sent_packet);
|
||||
bool network_changed = false;
|
||||
if (network_estimator_ && overuse_predictor_.Enabled()) {
|
||||
if (overuse_predictor_.Enabled()) {
|
||||
overuse_predictor_.OnSentPacket(sent_packet);
|
||||
auto estimate = network_estimator_->GetCurrentEstimate();
|
||||
if (estimate && overuse_predictor_.PredictOveruse(*estimate)) {
|
||||
if (estimate_ && overuse_predictor_.PredictOveruse(*estimate_)) {
|
||||
DataRate new_target = delay_based_bwe_->TriggerOveruse(
|
||||
sent_packet.send_time, acknowledged_bitrate_estimator_->bitrate());
|
||||
bandwidth_estimation_->UpdateDelayBasedEstimate(sent_packet.send_time,
|
||||
@ -510,19 +509,18 @@ NetworkControlUpdate GoogCcNetworkController::OnTransportPacketsFeedback(
|
||||
report.feedback_time);
|
||||
bandwidth_estimation_->IncomingPacketFeedbackVector(report);
|
||||
|
||||
if (network_estimator_)
|
||||
if (network_estimator_) {
|
||||
network_estimator_->OnTransportPacketsFeedback(report);
|
||||
estimate_ = network_estimator_->GetCurrentEstimate();
|
||||
}
|
||||
|
||||
NetworkControlUpdate update;
|
||||
bool recovered_from_overuse = false;
|
||||
bool backoff_in_alr = false;
|
||||
|
||||
DelayBasedBwe::Result result;
|
||||
absl::optional<NetworkStateEstimate> network_estimate =
|
||||
network_estimator_ ? network_estimator_->GetCurrentEstimate()
|
||||
: absl::nullopt;
|
||||
result = delay_based_bwe_->IncomingPacketFeedbackVector(
|
||||
report, acknowledged_bitrate, probe_bitrate, network_estimate,
|
||||
report, acknowledged_bitrate, probe_bitrate, estimate_,
|
||||
alr_start_time.has_value());
|
||||
|
||||
if (result.updated) {
|
||||
@ -568,6 +566,12 @@ NetworkControlUpdate GoogCcNetworkController::OnTransportPacketsFeedback(
|
||||
return update;
|
||||
}
|
||||
|
||||
NetworkControlUpdate GoogCcNetworkController::OnNetworkStateEstimate(
|
||||
NetworkStateEstimate msg) {
|
||||
estimate_ = msg;
|
||||
return NetworkControlUpdate();
|
||||
}
|
||||
|
||||
NetworkControlUpdate GoogCcNetworkController::GetNetworkState(
|
||||
Timestamp at_time) const {
|
||||
DataRate bandwidth = use_stable_bandwidth_estimate_
|
||||
|
||||
@ -64,6 +64,8 @@ class GoogCcNetworkController : public NetworkControllerInterface {
|
||||
NetworkControlUpdate OnTransportLossReport(TransportLossReport msg) override;
|
||||
NetworkControlUpdate OnTransportPacketsFeedback(
|
||||
TransportPacketsFeedback msg) override;
|
||||
NetworkControlUpdate OnNetworkStateEstimate(
|
||||
NetworkStateEstimate msg) override;
|
||||
|
||||
NetworkControlUpdate GetNetworkState(Timestamp at_time) const;
|
||||
|
||||
@ -110,6 +112,8 @@ class GoogCcNetworkController : public NetworkControllerInterface {
|
||||
|
||||
bool first_packet_sent_ = false;
|
||||
|
||||
absl::optional<NetworkStateEstimate> estimate_;
|
||||
|
||||
Timestamp next_loss_update_ = Timestamp::MinusInfinity();
|
||||
int lost_packets_since_last_loss_update_ = 0;
|
||||
int expected_packets_since_last_loss_update_ = 0;
|
||||
|
||||
Reference in New Issue
Block a user