#include "modules/audio_processing/agc2/input_volume_stats_reporter.h"
#include <cmath>
#include "absl/strings/string_view.h"
#include "rtc_base/logging.h"
#include "rtc_base/numerics/safe_minmax.h"
#include "rtc_base/strings/string_builder.h"
#include "system_wrappers/include/metrics.h"
namespace webrtc {
namespace {
InputVolumeType;
constexpr int kFramesIn60Seconds = …;
constexpr int kMinInputVolume = …;
constexpr int kMaxInputVolume = …;
constexpr int kMaxUpdate = …;
int ComputeAverageUpdate(int sum_updates, int num_updates) { … }
constexpr absl::string_view MetricNamePrefix(
InputVolumeType input_volume_type) { … }
metrics::Histogram* CreateVolumeHistogram(InputVolumeType input_volume_type) { … }
metrics::Histogram* CreateRateHistogram(InputVolumeType input_volume_type,
absl::string_view name) { … }
metrics::Histogram* CreateAverageHistogram(InputVolumeType input_volume_type,
absl::string_view name) { … }
}
InputVolumeStatsReporter::InputVolumeStatsReporter(InputVolumeType type)
: … { … }
InputVolumeStatsReporter::~InputVolumeStatsReporter() = default;
void InputVolumeStatsReporter::UpdateStatistics(int input_volume) { … }
void InputVolumeStatsReporter::LogVolumeUpdateStats() const { … }
void UpdateHistogramOnRecommendedInputVolumeChangeToMatchTarget(int volume) { … }
}