#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <algorithm>
#include <numeric>
#include <vector>
#include "base/base_switches.h"
#include "base/command_line.h"
#include "base/files/file_util.h"
#include "base/json/json_writer.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/base/media_switches.h"
#include "media/base/test_data_util.h"
#include "media/gpu/buildflags.h"
#include "media/gpu/test/video_bitstream.h"
#include "media/gpu/test/video_player/decoder_listener.h"
#include "media/gpu/test/video_player/decoder_wrapper.h"
#include "media/gpu/test/video_player/frame_renderer_dummy.h"
#include "media/gpu/test/video_player/video_player_test_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX)
#include "sandbox/linux/services/resource_limits.h"
#endif
namespace media {
namespace test {
namespace {
constexpr const char* usage_msg = …;
const std::string help_msg = …;
media::test::VideoPlayerTestEnvironment* g_env;
constexpr const base::FilePath::CharType* kDefaultOutputFolder = …);
constexpr base::TimeDelta kMultipleDecodersTimeout = …;
struct PerformanceTimeStats { … };
PerformanceTimeStats::PerformanceTimeStats(const std::vector<double>& times) { … }
struct PerformanceMetrics { … };
class PerformanceEvaluator : public VideoFrameProcessor { … };
void PerformanceEvaluator::ProcessVideoFrame(
scoped_refptr<const VideoFrame> video_frame,
size_t frame_index) { … }
void PerformanceEvaluator::StartMeasuring() { … }
void PerformanceEvaluator::StopMeasuring() { … }
void PerformanceEvaluator::WriteMetricsToFile() const { … }
class VideoDecoderTest : public ::testing::Test { … };
}
TEST_F(VideoDecoderTest, MeasureUncappedPerformance) { … }
TEST_F(VideoDecoderTest, MeasureCappedPerformance) { … }
TEST_F(VideoDecoderTest, MeasureUncappedPerformance_TenConcurrentDecoders) { … }
}
}
int main(int argc, char** argv) { … }