#include <va/va.h>
#include <fstream>
#include <iostream>
#include <optional>
#include <sstream>
#include <string>
#include "base/command_line.h"
#include "base/files/memory_mapped_file.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "build/chromeos_buildflags.h"
#include "media/gpu/vaapi/test/av1_decoder.h"
#include "media/gpu/vaapi/test/h264_decoder.h"
#include "media/gpu/vaapi/test/shared_va_surface.h"
#include "media/gpu/vaapi/test/vaapi_device.h"
#include "media/gpu/vaapi/test/video_decoder.h"
#include "media/gpu/vaapi/test/vp8_decoder.h"
#include "media/gpu/vaapi/test/vp9_decoder.h"
#include "media/gpu/vaapi/va_stubs.h"
#include "media/media_buildflags.h"
#include "media/parsers/ivf_parser.h"
#include "ui/gfx/geometry/size.h"
#if BUILDFLAG(ENABLE_PLATFORM_HEVC)
#include "media/gpu/vaapi/test/h265_decoder.h"
#endif
Av1Decoder;
H264Decoder;
#if BUILDFLAG(ENABLE_PLATFORM_HEVC)
using media::vaapi_test::H265Decoder;
#endif
SharedVASurface;
VaapiDevice;
VideoDecoder;
Vp8Decoder;
Vp9Decoder;
InitializeStubs;
kModuleVa;
kModuleVa_drm;
#if BUILDFLAG(IS_CHROMEOS_ASH)
using media_gpu_vaapi::kModuleVa_prot;
#endif
StubPathMap;
namespace {
constexpr char kUsageMsg[] = …;
constexpr char kHelpMsg[] = …;
std::unique_ptr<VideoDecoder> CreateDecoder(
const std::string& codec,
const VaapiDevice& va_device,
SharedVASurface::FetchPolicy fetch_policy,
const uint8_t* stream_data,
size_t stream_len) { … }
std::optional<SharedVASurface::FetchPolicy> GetFetchPolicy(
const VaapiDevice& va_device,
const std::string& fetch_policy) { … }
}
int main(int argc, char** argv) { … }