#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/mojo/mojom/video_frame_mojom_traits.h"
#include <utility>
#include <vector>
#include "base/functional/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "gpu/ipc/common/gpu_memory_buffer_support.h"
#include "media/base/color_plane_layout.h"
#include "media/base/format_utils.h"
#include "media/mojo/mojom/video_frame_metadata_mojom_traits.h"
#include "mojo/public/cpp/base/time_mojom_traits.h"
#include "mojo/public/cpp/system/handle.h"
#include "ui/gfx/mojom/buffer_types_mojom_traits.h"
#include "ui/gfx/mojom/color_space_mojom_traits.h"
#include "ui/gfx/mojom/hdr_metadata_mojom_traits.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "base/posix/eintr_wrapper.h"
#endif
namespace mojo {
namespace {
base::ReadOnlySharedMemoryRegion CreateRegion(const media::VideoFrame& frame,
std::vector<uint32_t>& offsets,
std::vector<int32_t>& strides) { … }
media::mojom::VideoFrameDataPtr MakeVideoFrameData(
const media::VideoFrame* input) { … }
}
media::mojom::SharedImageFormatType EnumTraits<
media::mojom::SharedImageFormatType,
media::SharedImageFormatType>::ToMojom(media::SharedImageFormatType type) { … }
bool EnumTraits<media::mojom::SharedImageFormatType,
media::SharedImageFormatType>::
FromMojom(media::mojom::SharedImageFormatType input,
media::SharedImageFormatType* out) { … }
media::mojom::VideoFrameDataPtr StructTraits<media::mojom::VideoFrameDataView,
scoped_refptr<media::VideoFrame>>::
data(const scoped_refptr<media::VideoFrame>& input) { … }
bool StructTraits<media::mojom::VideoFrameDataView,
scoped_refptr<media::VideoFrame>>::
Read(media::mojom::VideoFrameDataView input,
scoped_refptr<media::VideoFrame>* output) { … }
}