#include "media/capture/video/shared_memory_buffer_tracker.h"
#include "base/check.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "media/base/video_frame.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "ui/gfx/geometry/size.h"
namespace {
class SharedMemoryBufferTrackerHandle : public media::VideoCaptureBufferHandle { … };
size_t CalculateRequiredBufferSize(
const gfx::Size& dimensions,
media::VideoPixelFormat format,
const media::mojom::PlaneStridesPtr& strides) { … }
}
namespace media {
SharedMemoryBufferTracker::SharedMemoryBufferTracker(bool strict_pixel_format)
: … { … }
SharedMemoryBufferTracker::~SharedMemoryBufferTracker() = default;
bool SharedMemoryBufferTracker::Init(const gfx::Size& dimensions,
VideoPixelFormat format,
const mojom::PlaneStridesPtr& strides) { … }
bool SharedMemoryBufferTracker::IsReusableForFormat(
const gfx::Size& dimensions,
VideoPixelFormat format,
const mojom::PlaneStridesPtr& strides) { … }
std::unique_ptr<VideoCaptureBufferHandle>
SharedMemoryBufferTracker::GetMemoryMappedAccess() { … }
base::UnsafeSharedMemoryRegion
SharedMemoryBufferTracker::DuplicateAsUnsafeRegion() { … }
gfx::GpuMemoryBufferHandle
SharedMemoryBufferTracker::GetGpuMemoryBufferHandle() { … }
VideoCaptureBufferType SharedMemoryBufferTracker::GetBufferType() { … }
uint32_t SharedMemoryBufferTracker::GetMemorySizeInBytes() { … }
}