#include "media/filters/video_cadence_estimator.h"
#include <algorithm>
#include <cmath>
#include <iterator>
#include <limits>
#include <numeric>
#include <string>
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "media/base/media_switches.h"
namespace media {
const int kMinimumCadenceDurationMs = …;
const double kVariableFPSFactor = …;
const double kConstantFPSFactor = …;
static void HistogramCadenceChangeCount(int cadence_changes) { … }
VideoCadenceEstimator::Cadence ConstructCadence(int k, int n) { … }
VideoCadenceEstimator::Cadence ConstructSimpleCadence(
double perfect_cadence,
base::TimeDelta max_acceptable_drift,
base::TimeDelta* time_until_max_drift) { … }
VideoCadenceEstimator::VideoCadenceEstimator(
base::TimeDelta minimum_time_until_max_drift)
: … { … }
VideoCadenceEstimator::~VideoCadenceEstimator() = default;
void VideoCadenceEstimator::Reset() { … }
bool VideoCadenceEstimator::UpdateCadenceEstimate(
base::TimeDelta render_interval,
base::TimeDelta frame_duration,
base::TimeDelta frame_duration_deviation,
base::TimeDelta max_acceptable_drift) { … }
void VideoCadenceEstimator::UpdateCadenceInternal(
Cadence new_cadence,
base::TimeDelta time_until_max_drift) { … }
int VideoCadenceEstimator::GetCadenceForFrame(uint64_t frame_number) const { … }
bool VideoCadenceEstimator::HasSimpleCadence(
base::TimeDelta render_interval,
base::TimeDelta frame_duration,
base::TimeDelta minimum_time_until_max_drift) { … }
VideoCadenceEstimator::Cadence VideoCadenceEstimator::CalculateCadence(
base::TimeDelta render_interval,
base::TimeDelta frame_duration,
base::TimeDelta max_acceptable_drift,
base::TimeDelta* time_until_max_drift) const { … }
std::string VideoCadenceEstimator::CadenceToString(
const Cadence& cadence) const { … }
double VideoCadenceEstimator::avg_cadence_for_testing() const { … }
}