chromium/media/gpu/vaapi/test/decode.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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[] =;

// Creates the decoder for |stream_data| based on the user-provided
// value. If the user requests a valid codec that is not suitable
// for decoding |stream_data| the behavior will be undefined. Returns
// nullptr on failure.
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) {}

}  // namespace

int main(int argc, char** argv) {}