#include "modules/congestion_controller/goog_cc/loss_based_bandwidth_estimation.h"
#include <algorithm>
#include <cmath>
#include <vector>
#include "absl/strings/match.h"
#include "absl/strings/string_view.h"
#include "api/field_trials_view.h"
#include "api/transport/network_types.h"
#include "api/units/data_rate.h"
#include "api/units/time_delta.h"
#include "api/units/timestamp.h"
#include "rtc_base/checks.h"
#include "rtc_base/experiments/field_trial_parser.h"
namespace webrtc {
namespace {
const char kBweLossBasedControl[] = …;
constexpr TimeDelta kMaxRtcpFeedbackInterval = …;
double GetIncreaseFactor(const LossBasedControlConfig& config, TimeDelta rtt) { … }
double LossFromBitrate(DataRate bitrate,
DataRate loss_bandwidth_balance,
double exponent) { … }
DataRate BitrateFromLoss(double loss,
DataRate loss_bandwidth_balance,
double exponent) { … }
double ExponentialUpdate(TimeDelta window, TimeDelta interval) { … }
bool IsEnabled(const webrtc::FieldTrialsView& key_value_config,
absl::string_view name) { … }
}
LossBasedControlConfig::LossBasedControlConfig(
const FieldTrialsView* key_value_config)
: … { … }
LossBasedControlConfig::LossBasedControlConfig(const LossBasedControlConfig&) =
default;
LossBasedControlConfig::~LossBasedControlConfig() = default;
LossBasedBandwidthEstimation::LossBasedBandwidthEstimation(
const FieldTrialsView* key_value_config)
: … { … }
void LossBasedBandwidthEstimation::UpdateLossStatistics(
const std::vector<PacketResult>& packet_results,
Timestamp at_time) { … }
void LossBasedBandwidthEstimation::UpdateAcknowledgedBitrate(
DataRate acknowledged_bitrate,
Timestamp at_time) { … }
DataRate LossBasedBandwidthEstimation::Update(Timestamp at_time,
DataRate min_bitrate,
DataRate wanted_bitrate,
TimeDelta last_round_trip_time) { … }
void LossBasedBandwidthEstimation::Initialize(DataRate bitrate) { … }
double LossBasedBandwidthEstimation::loss_reset_threshold() const { … }
double LossBasedBandwidthEstimation::loss_increase_threshold() const { … }
double LossBasedBandwidthEstimation::loss_decrease_threshold() const { … }
DataRate LossBasedBandwidthEstimation::decreased_bitrate() const { … }
}