#include "rtc_base/experiments/balanced_degradation_settings.h"
#include <limits>
#include "rtc_base/experiments/field_trial_list.h"
#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/logging.h"
namespace webrtc {
namespace {
constexpr char kFieldTrial[] = …;
constexpr int kMinFps = …;
constexpr int kMaxFps = …;
std::vector<BalancedDegradationSettings::Config> DefaultConfigs() { … }
bool IsValidConfig(
const BalancedDegradationSettings::CodecTypeSpecific& config) { … }
bool IsValid(const BalancedDegradationSettings::CodecTypeSpecific& config1,
const BalancedDegradationSettings::CodecTypeSpecific& config2) { … }
bool IsValid(const std::vector<BalancedDegradationSettings::Config>& configs) { … }
std::vector<BalancedDegradationSettings::Config> GetValidOrDefault(
const std::vector<BalancedDegradationSettings::Config>& configs) { … }
absl::optional<VideoEncoder::QpThresholds> GetThresholds(
VideoCodecType type,
const BalancedDegradationSettings::Config& config) { … }
int GetFps(VideoCodecType type,
const absl::optional<BalancedDegradationSettings::Config>& config) { … }
absl::optional<int> GetKbps(
VideoCodecType type,
const absl::optional<BalancedDegradationSettings::Config>& config) { … }
absl::optional<int> GetKbpsRes(
VideoCodecType type,
const absl::optional<BalancedDegradationSettings::Config>& config) { … }
}
absl::optional<int> BalancedDegradationSettings::CodecTypeSpecific::GetQpLow()
const { … }
absl::optional<int> BalancedDegradationSettings::CodecTypeSpecific::GetQpHigh()
const { … }
absl::optional<int> BalancedDegradationSettings::CodecTypeSpecific::GetFps()
const { … }
absl::optional<int> BalancedDegradationSettings::CodecTypeSpecific::GetKbps()
const { … }
absl::optional<int> BalancedDegradationSettings::CodecTypeSpecific::GetKbpsRes()
const { … }
BalancedDegradationSettings::Config::Config() = default;
BalancedDegradationSettings::Config::Config(int pixels,
int fps,
int kbps,
int kbps_res,
int fps_diff,
CodecTypeSpecific vp8,
CodecTypeSpecific vp9,
CodecTypeSpecific h264,
CodecTypeSpecific av1,
CodecTypeSpecific generic)
: … { … }
BalancedDegradationSettings::BalancedDegradationSettings(
const FieldTrialsView& field_trials) { … }
BalancedDegradationSettings::~BalancedDegradationSettings() { … }
std::vector<BalancedDegradationSettings::Config>
BalancedDegradationSettings::GetConfigs() const { … }
int BalancedDegradationSettings::MinFps(VideoCodecType type, int pixels) const { … }
absl::optional<BalancedDegradationSettings::Config>
BalancedDegradationSettings::GetMinFpsConfig(int pixels) const { … }
int BalancedDegradationSettings::MaxFps(VideoCodecType type, int pixels) const { … }
absl::optional<BalancedDegradationSettings::Config>
BalancedDegradationSettings::GetMaxFpsConfig(int pixels) const { … }
bool BalancedDegradationSettings::CanAdaptUp(VideoCodecType type,
int pixels,
uint32_t bitrate_bps) const { … }
bool BalancedDegradationSettings::CanAdaptUpResolution(
VideoCodecType type,
int pixels,
uint32_t bitrate_bps) const { … }
absl::optional<int> BalancedDegradationSettings::MinFpsDiff(int pixels) const { … }
absl::optional<VideoEncoder::QpThresholds>
BalancedDegradationSettings::GetQpThresholds(VideoCodecType type,
int pixels) const { … }
BalancedDegradationSettings::Config BalancedDegradationSettings::GetConfig(
int pixels) const { … }
}