#include "third_party/blink/renderer/platform/media/video_decode_stats_reporter.h"
#include <cmath>
#include <limits>
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/task/single_thread_task_runner.h"
#include "media/capabilities/bucket_utility.h"
#include "media/mojo/mojom/media_types.mojom.h"
namespace blink {
VideoDecodeStatsReporter::VideoDecodeStatsReporter(
mojo::PendingRemote<media::mojom::VideoDecodeStatsRecorder> recorder_remote,
GetPipelineStatsCB get_pipeline_stats_cb,
media::VideoCodecProfile codec_profile,
const gfx::Size& natural_size,
std::optional<media::CdmConfig> cdm_config,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
const base::TickClock* tick_clock)
: … { … }
VideoDecodeStatsReporter::~VideoDecodeStatsReporter() = default;
void VideoDecodeStatsReporter::OnPlaying() { … }
void VideoDecodeStatsReporter::OnPaused() { … }
void VideoDecodeStatsReporter::OnHidden() { … }
void VideoDecodeStatsReporter::OnShown() { … }
bool VideoDecodeStatsReporter::MatchesBucketedNaturalSize(
const gfx::Size& natural_size) const { … }
void VideoDecodeStatsReporter::RunStatsTimerAtInterval(
base::TimeDelta interval) { … }
void VideoDecodeStatsReporter::StartNewRecord(
uint32_t frames_decoded_offset,
uint32_t frames_dropped_offset,
uint32_t frames_decoded_power_efficient_offset) { … }
void VideoDecodeStatsReporter::ResetFrameRateState() { … }
bool VideoDecodeStatsReporter::ShouldBeReporting() const { … }
void VideoDecodeStatsReporter::OnIpcConnectionError() { … }
bool VideoDecodeStatsReporter::UpdateDecodeProgress(
const media::PipelineStatistics& stats) { … }
bool VideoDecodeStatsReporter::UpdateFrameRateStability(
const media::PipelineStatistics& stats) { … }
void VideoDecodeStatsReporter::UpdateStats() { … }
}