#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/filters/video_renderer_algorithm.h"
#include <stddef.h>
#include <stdint.h>
#include <cmath>
#include <tuple>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/ref_counted.h"
#include "base/strings/stringprintf.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/base/media_util.h"
#include "media/base/timestamp_constants.h"
#include "media/base/video_frame_pool.h"
#include "media/base/wall_clock_time_source.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace media {
static double NTSC(double fps) { … }
class TickGenerator { … };
class VideoRendererAlgorithmTest : public testing::Test { … };
TEST_F(VideoRendererAlgorithmTest, Empty) { … }
TEST_F(VideoRendererAlgorithmTest, Reset) { … }
TEST_F(VideoRendererAlgorithmTest, AccountForMissingIntervals) { … }
TEST_F(VideoRendererAlgorithmTest, OnLastFrameDropped) { … }
TEST_F(VideoRendererAlgorithmTest, OnLastFrameDroppedFirstFrame) { … }
TEST_F(VideoRendererAlgorithmTest, EffectiveFramesQueued) { … }
TEST_F(VideoRendererAlgorithmTest, EffectiveFramesQueuedWithoutCadence) { … }
TEST_F(VideoRendererAlgorithmTest, EffectiveFramesQueuedWithoutFrameDropping) { … }
TEST_F(VideoRendererAlgorithmTest, AcceptableDriftUpdated) { … }
TEST_F(VideoRendererAlgorithmTest, TimeIsStopped) { … }
TEST_F(VideoRendererAlgorithmTest, SortedFrameQueue) { … }
TEST_F(VideoRendererAlgorithmTest, BestFrameByCadence) { … }
TEST_F(VideoRendererAlgorithmTest, BestFrameByCadenceOverdisplayed) { … }
TEST_F(VideoRendererAlgorithmTest, BestFrameByCadenceOverdisplayedForDrift) { … }
TEST_F(VideoRendererAlgorithmTest, BestFrameByCoverage) { … }
TEST_F(VideoRendererAlgorithmTest, BestFrameByDriftAndDriftCalculations) { … }
TEST_F(VideoRendererAlgorithmTest, BestFrameByFractionalCadence) { … }
TEST_F(VideoRendererAlgorithmTest, FilmCadence) { … }
TEST_F(VideoRendererAlgorithmTest, CadenceCalculations) { … }
TEST_F(VideoRendererAlgorithmTest, RemoveExpiredFramesWithoutRendering) { … }
TEST_F(VideoRendererAlgorithmTest, RemoveExpiredFrames) { … }
TEST_F(VideoRendererAlgorithmTest, RemoveExpiredFramesPartialReset) { … }
TEST_F(VideoRendererAlgorithmTest, RemoveExpiredFramesCadence) { … }
TEST_F(VideoRendererAlgorithmTest, RemoveExpiredFramesFractionalCadence) { … }
class VideoRendererAlgorithmCadenceTest
: public VideoRendererAlgorithmTest,
public ::testing::WithParamInterface<::testing::tuple<double, double>> { … };
TEST_P(VideoRendererAlgorithmCadenceTest, CadenceTest) { … }
const double kDisplayRates[] = …;
const double kTestRates[] = …;
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(VideoRendererAlgorithmTest, VariablePlaybackRateCadence) { … }
TEST_F(VideoRendererAlgorithmTest, UglyTimestampsHaveCadence) { … }
TEST_F(VideoRendererAlgorithmTest, VariableFrameRateNoCadence) { … }
TEST_F(VideoRendererAlgorithmTest, EnqueueFrames) { … }
TEST_F(VideoRendererAlgorithmTest, CadenceForFutureFrames) { … }
TEST_F(VideoRendererAlgorithmTest, InfiniteDurationMetadata) { … }
TEST_F(VideoRendererAlgorithmTest, UsesFrameDuration) { … }
TEST_F(VideoRendererAlgorithmTest, WallClockDurationMetadataSet) { … }
}