#include "modules/audio_coding/neteq/statistics_calculator.h"
#include <string.h>
#include <algorithm>
#include "absl/strings/string_view.h"
#include "modules/audio_coding/neteq/delay_manager.h"
#include "rtc_base/checks.h"
#include "rtc_base/numerics/safe_conversions.h"
#include "system_wrappers/include/metrics.h"
namespace webrtc {
namespace {
size_t AddIntToSizeTWithLowerCap(int a, size_t b) { … }
constexpr int kInterruptionLenMs = …;
}
const size_t StatisticsCalculator::kLenWaitingTimes;
StatisticsCalculator::PeriodicUmaLogger::PeriodicUmaLogger(
absl::string_view uma_name,
int report_interval_ms,
int max_value)
: … { … }
StatisticsCalculator::PeriodicUmaLogger::~PeriodicUmaLogger() = default;
void StatisticsCalculator::PeriodicUmaLogger::AdvanceClock(int step_ms) { … }
void StatisticsCalculator::PeriodicUmaLogger::LogToUma(int value) const { … }
StatisticsCalculator::PeriodicUmaCount::PeriodicUmaCount(
absl::string_view uma_name,
int report_interval_ms,
int max_value)
: … { … }
StatisticsCalculator::PeriodicUmaCount::~PeriodicUmaCount() { … }
void StatisticsCalculator::PeriodicUmaCount::RegisterSample() { … }
int StatisticsCalculator::PeriodicUmaCount::Metric() const { … }
void StatisticsCalculator::PeriodicUmaCount::Reset() { … }
StatisticsCalculator::PeriodicUmaAverage::PeriodicUmaAverage(
absl::string_view uma_name,
int report_interval_ms,
int max_value)
: … { … }
StatisticsCalculator::PeriodicUmaAverage::~PeriodicUmaAverage() { … }
void StatisticsCalculator::PeriodicUmaAverage::RegisterSample(int value) { … }
int StatisticsCalculator::PeriodicUmaAverage::Metric() const { … }
void StatisticsCalculator::PeriodicUmaAverage::Reset() { … }
StatisticsCalculator::StatisticsCalculator()
: … { … }
StatisticsCalculator::~StatisticsCalculator() = default;
void StatisticsCalculator::Reset() { … }
void StatisticsCalculator::ResetMcu() { … }
void StatisticsCalculator::ExpandedVoiceSamples(size_t num_samples,
bool is_new_concealment_event) { … }
void StatisticsCalculator::ExpandedNoiseSamples(size_t num_samples,
bool is_new_concealment_event) { … }
void StatisticsCalculator::ExpandedVoiceSamplesCorrection(int num_samples) { … }
void StatisticsCalculator::ExpandedNoiseSamplesCorrection(int num_samples) { … }
void StatisticsCalculator::DecodedOutputPlayed() { … }
void StatisticsCalculator::EndExpandEvent(int fs_hz) { … }
void StatisticsCalculator::ConcealedSamplesCorrection(int num_samples,
bool is_voice) { … }
void StatisticsCalculator::PreemptiveExpandedSamples(size_t num_samples) { … }
void StatisticsCalculator::AcceleratedSamples(size_t num_samples) { … }
void StatisticsCalculator::GeneratedNoiseSamples(size_t num_samples) { … }
void StatisticsCalculator::PacketsDiscarded(size_t num_packets) { … }
void StatisticsCalculator::SecondaryPacketsDiscarded(size_t num_packets) { … }
void StatisticsCalculator::SecondaryPacketsReceived(size_t num_packets) { … }
void StatisticsCalculator::IncreaseCounter(size_t num_samples, int fs_hz) { … }
void StatisticsCalculator::JitterBufferDelay(size_t num_samples,
uint64_t waiting_time_ms,
uint64_t target_delay_ms,
uint64_t unlimited_target_delay_ms,
uint64_t processing_delay_us) { … }
void StatisticsCalculator::SecondaryDecodedSamples(int num_samples) { … }
void StatisticsCalculator::FlushedPacketBuffer() { … }
void StatisticsCalculator::ReceivedPacket() { … }
void StatisticsCalculator::RelativePacketArrivalDelay(size_t delay_ms) { … }
void StatisticsCalculator::LogDelayedPacketOutageEvent(int num_samples,
int fs_hz) { … }
void StatisticsCalculator::StoreWaitingTime(int waiting_time_ms) { … }
void StatisticsCalculator::GetNetworkStatistics(size_t samples_per_packet,
NetEqNetworkStatistics* stats) { … }
NetEqLifetimeStatistics StatisticsCalculator::GetLifetimeStatistics() const { … }
NetEqOperationsAndState StatisticsCalculator::GetOperationsAndState() const { … }
uint16_t StatisticsCalculator::CalculateQ14Ratio(size_t numerator,
uint32_t denominator) { … }
}