#include "media/capture/content/animated_content_sampler.h"
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include "base/containers/adapters.h"
namespace media {
namespace {
constexpr auto kMinObservationWindow = …;
constexpr auto kMaxObservationWindow = …;
constexpr auto kNonAnimatingThreshold = …;
constexpr auto kMaxLockInPeriod = …;
constexpr auto kDriftCorrection = …;
}
AnimatedContentSampler::AnimatedContentSampler(
base::TimeDelta min_capture_period)
: … { … }
AnimatedContentSampler::~AnimatedContentSampler() = default;
void AnimatedContentSampler::SetMinCapturePeriod(base::TimeDelta period) { … }
void AnimatedContentSampler::SetTargetSamplingPeriod(base::TimeDelta period) { … }
void AnimatedContentSampler::ConsiderPresentationEvent(
const gfx::Rect& damage_rect,
base::TimeTicks event_time) { … }
bool AnimatedContentSampler::HasProposal() const { … }
bool AnimatedContentSampler::ShouldSample() const { … }
void AnimatedContentSampler::RecordSample(base::TimeTicks frame_timestamp) { … }
void AnimatedContentSampler::AddObservation(const gfx::Rect& damage_rect,
base::TimeTicks event_time) { … }
gfx::Rect AnimatedContentSampler::ElectMajorityDamageRect() const { … }
bool AnimatedContentSampler::AnalyzeObservations(
base::TimeTicks event_time,
gfx::Rect* rect,
base::TimeDelta* period) const { … }
base::TimeTicks AnimatedContentSampler::ComputeNextFrameTimestamp(
base::TimeTicks event_time) const { … }
base::TimeDelta AnimatedContentSampler::ComputeSamplingPeriod(
base::TimeDelta animation_period,
base::TimeDelta target_sampling_period,
base::TimeDelta min_capture_period) { … }
}