#include "media/base/video_frame_layout.h"
#include <string.h>
#include <numeric>
#include <sstream>
#include "base/notreached.h"
#include "base/numerics/checked_math.h"
namespace media {
namespace {
template <class T>
std::string VectorToString(const std::vector<T>& vec) { … }
std::vector<ColorPlaneLayout> PlanesFromStrides(
const std::vector<int32_t> strides) { … }
}
size_t VideoFrameLayout::NumPlanes(VideoPixelFormat format) { … }
std::optional<VideoFrameLayout> VideoFrameLayout::Create(
VideoPixelFormat format,
const gfx::Size& coded_size) { … }
std::optional<VideoFrameLayout> VideoFrameLayout::CreateWithStrides(
VideoPixelFormat format,
const gfx::Size& coded_size,
std::vector<int32_t> strides,
size_t buffer_addr_align,
uint64_t modifier) { … }
std::optional<VideoFrameLayout> VideoFrameLayout::CreateWithPlanes(
VideoPixelFormat format,
const gfx::Size& coded_size,
std::vector<ColorPlaneLayout> planes,
size_t buffer_addr_align,
uint64_t modifier) { … }
std::optional<VideoFrameLayout> VideoFrameLayout::CreateMultiPlanar(
VideoPixelFormat format,
const gfx::Size& coded_size,
std::vector<ColorPlaneLayout> planes,
size_t buffer_addr_align,
uint64_t modifier) { … }
VideoFrameLayout::VideoFrameLayout(VideoPixelFormat format,
const gfx::Size& coded_size,
std::vector<ColorPlaneLayout> planes,
bool is_multi_planar,
size_t buffer_addr_align,
uint64_t modifier)
: … { … }
VideoFrameLayout::~VideoFrameLayout() = default;
VideoFrameLayout::VideoFrameLayout(const VideoFrameLayout&) = default;
VideoFrameLayout::VideoFrameLayout(VideoFrameLayout&&) = default;
VideoFrameLayout& VideoFrameLayout::operator=(const VideoFrameLayout&) =
default;
bool VideoFrameLayout::operator==(const VideoFrameLayout& rhs) const { … }
bool VideoFrameLayout::operator!=(const VideoFrameLayout& rhs) const { … }
bool VideoFrameLayout::FitsInContiguousBufferOfSize(size_t data_size) const { … }
std::ostream& operator<<(std::ostream& ostream,
const VideoFrameLayout& layout) { … }
}