#include "media/filters/video_renderer_algorithm.h"
#include <limits>
#include "base/ranges/algorithm.h"
#include "media/base/media_log.h"
namespace media {
const int kMaxOutOfOrderFrameLogs = …;
VideoRendererAlgorithm::ReadyFrame::ReadyFrame(
scoped_refptr<VideoFrame> ready_frame)
: … { … }
VideoRendererAlgorithm::ReadyFrame::ReadyFrame(const ReadyFrame& other) =
default;
VideoRendererAlgorithm::ReadyFrame::~ReadyFrame() = default;
bool VideoRendererAlgorithm::ReadyFrame::operator<(
const ReadyFrame& other) const { … }
VideoRendererAlgorithm::VideoRendererAlgorithm(
const TimeSource::WallClockTimeCB& wall_clock_time_cb,
MediaLog* media_log)
: … { … }
VideoRendererAlgorithm::~VideoRendererAlgorithm() = default;
scoped_refptr<VideoFrame> VideoRendererAlgorithm::Render(
base::TimeTicks deadline_min,
base::TimeTicks deadline_max,
size_t* frames_dropped) { … }
size_t VideoRendererAlgorithm::RemoveExpiredFrames(base::TimeTicks deadline) { … }
void VideoRendererAlgorithm::OnLastFrameDropped() { … }
void VideoRendererAlgorithm::Reset(ResetFlag reset_flag) { … }
int64_t VideoRendererAlgorithm::GetMemoryUsage() const { … }
void VideoRendererAlgorithm::EnqueueFrame(scoped_refptr<VideoFrame> frame) { … }
void VideoRendererAlgorithm::AccountForMissedIntervals(
base::TimeTicks deadline_min,
base::TimeTicks deadline_max) { … }
void VideoRendererAlgorithm::UpdateFrameStatistics() { … }
void VideoRendererAlgorithm::UpdateCadenceForFrames() { … }
int VideoRendererAlgorithm::FindBestFrameByCadence() const { … }
int VideoRendererAlgorithm::FindBestFrameByCoverage(
base::TimeTicks deadline_min,
base::TimeTicks deadline_max,
int* second_best) const { … }
int VideoRendererAlgorithm::FindBestFrameByDrift(
base::TimeTicks deadline_min,
base::TimeDelta* selected_frame_drift) const { … }
base::TimeDelta VideoRendererAlgorithm::CalculateAbsoluteDriftForFrame(
base::TimeTicks deadline_min,
int frame_index) const { … }
void VideoRendererAlgorithm::UpdateEffectiveFramesQueued() { … }
int VideoRendererAlgorithm::FindFirstGoodFrame() const { … }
size_t VideoRendererAlgorithm::CountEffectiveFramesQueued() const { … }
}