#include "modules/audio_coding/audio_network_adaptor/frame_length_controller.h"
#include <algorithm>
#include <iterator>
#include <utility>
#include "rtc_base/checks.h"
namespace webrtc {
namespace {
constexpr int kPreventOveruseMarginBps = …;
int OverheadRateBps(size_t overhead_bytes_per_packet, int frame_length_ms) { … }
}
FrameLengthController::Config::Config(
const std::set<int>& encoder_frame_lengths_ms,
int initial_frame_length_ms,
int min_encoder_bitrate_bps,
float fl_increasing_packet_loss_fraction,
float fl_decreasing_packet_loss_fraction,
int fl_increase_overhead_offset,
int fl_decrease_overhead_offset,
std::map<FrameLengthChange, int> fl_changing_bandwidths_bps)
: … { … }
FrameLengthController::Config::Config(const Config& other) = default;
FrameLengthController::Config::~Config() = default;
FrameLengthController::FrameLengthController(const Config& config)
: … { … }
FrameLengthController::~FrameLengthController() = default;
void FrameLengthController::UpdateNetworkMetrics(
const NetworkMetrics& network_metrics) { … }
void FrameLengthController::MakeDecision(AudioEncoderRuntimeConfig* config) { … }
FrameLengthController::Config::FrameLengthChange::FrameLengthChange(
int from_frame_length_ms,
int to_frame_length_ms)
: … { … }
bool FrameLengthController::Config::FrameLengthChange::operator<(
const FrameLengthChange& rhs) const { … }
bool FrameLengthController::FrameLengthIncreasingDecision(
const AudioEncoderRuntimeConfig& config) { … }
bool FrameLengthController::FrameLengthDecreasingDecision(
const AudioEncoderRuntimeConfig& config) { … }
}