#include "media/gpu/buffer_validation.h"
#include <algorithm>
#include <cstdint>
#include "base/logging.h"
#include "base/numerics/checked_math.h"
#include "base/numerics/safe_conversions.h"
#include "build/build_config.h"
#include "media/base/video_frame.h"
#include "media/media_buildflags.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/gpu_memory_buffer.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include <drm_fourcc.h>
#include <sys/types.h>
#include <unistd.h>
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "ui/gfx/switches.h"
#endif
namespace media {
namespace {
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#ifndef I915_FORMAT_MOD_4_TILED_MTL_MC_CCS
#define I915_FORMAT_MOD_4_TILED_MTL_MC_CCS …
#endif
bool IsIntelMediaCompressedModifier(uint64_t modifier) { … }
#endif
}
bool GetFileSize(const int fd, size_t* size) { … }
bool VerifyGpuMemoryBufferHandle(
media::VideoPixelFormat pixel_format,
const gfx::Size& coded_size,
const gfx::GpuMemoryBufferHandle& gmb_handle,
GetFileSizeCBForTesting file_size_cb_for_testing) { … }
}