#include "cc/metrics/video_playback_roughness_reporter.h"
#include <algorithm>
#include "base/containers/adapters.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_macros.h"
#include "base/numerics/safe_conversions.h"
#include "components/viz/common/quads/compositor_frame_metadata.h"
namespace {
constexpr int max_worst_windows_size() { … }
}
namespace cc {
constexpr int VideoPlaybackRoughnessReporter::kMinWindowSize;
constexpr int VideoPlaybackRoughnessReporter::kMaxWindowSize;
constexpr int VideoPlaybackRoughnessReporter::kMaxWindowsBeforeSubmit;
constexpr int VideoPlaybackRoughnessReporter::kMinWindowsBeforeSubmit;
constexpr int VideoPlaybackRoughnessReporter::kPercentileToSubmit;
VideoPlaybackRoughnessReporter::VideoPlaybackRoughnessReporter(
ReportingCallback reporting_cb)
: … { … }
VideoPlaybackRoughnessReporter::~VideoPlaybackRoughnessReporter() = default;
double VideoPlaybackRoughnessReporter::ConsecutiveFramesWindow::roughness()
const { … }
VideoPlaybackRoughnessReporter::FrameInfo::FrameInfo() = default;
VideoPlaybackRoughnessReporter::FrameInfo::FrameInfo(const FrameInfo&) =
default;
void VideoPlaybackRoughnessReporter::FrameSubmitted(
TokenType token,
const media::VideoFrame& frame,
base::TimeDelta render_interval) { … }
void VideoPlaybackRoughnessReporter::FramePresented(TokenType token,
base::TimeTicks timestamp,
bool reliable_timestamp) { … }
void VideoPlaybackRoughnessReporter::SubmitPlaybackRoughness() { … }
void VideoPlaybackRoughnessReporter::ReportWindow(
const ConsecutiveFramesWindow& win) { … }
void VideoPlaybackRoughnessReporter::ProcessFrameWindow() { … }
void VideoPlaybackRoughnessReporter::Reset() { … }
}