#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/gpu/test/video_bitstream.h"
#include <optional>
#include "base/containers/contains.h"
#include "base/files/file_util.h"
#include "base/files/memory_mapped_file.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_util.h"
namespace media::test {
namespace {
constexpr const base::FilePath::CharType* kMetadataSuffix = …);
std::optional<VideoCodecProfile> ConvertStringtoProfile(
const std::string& profile) { … }
std::unique_ptr<base::MemoryMappedFile> LoadData(
const base::FilePath& data_file_path) { … }
}
bool VideoBitstream::LoadMetadata(const base::FilePath& json_file_path,
Metadata& metadata) { … }
VideoBitstream::VideoBitstream(
std::unique_ptr<base::MemoryMappedFile> memory_mapped_file,
const Metadata& metadata)
: … { … }
VideoBitstream::~VideoBitstream() = default;
VideoBitstream::Metadata::Metadata() = default;
VideoBitstream::Metadata::~Metadata() = default;
VideoBitstream::Metadata::Metadata(const Metadata&) = default;
VideoBitstream::Metadata& VideoBitstream::Metadata::operator=(const Metadata&) =
default;
std::unique_ptr<VideoBitstream> VideoBitstream::Create(
const base::FilePath& file_path,
const base::FilePath& metadata_file_path) { … }
base::span<const uint8_t> VideoBitstream::Data() const { … }
base::FilePath VideoBitstream::test_data_path_;
void VideoBitstream::SetTestDataPath(const base::FilePath& test_data_path) { … }
base::FilePath VideoBitstream::ResolveFilePath(
const base::FilePath& file_path) { … }
}