39 const std::vector<unsigned int> &planeSizes,
40 std::vector<std::unique_ptr<FrameBuffer>> *buffers);
43 std::unique_ptr<FrameBuffer> createBuffer(
44 std::string name,
const std::vector<unsigned int> &planeSizes);
46 UniqueFD allocFromHeap(
const char *name, std::size_t size);
47 UniqueFD allocFromUDmaBuf(
const char *name, std::size_t size);
71 void sync(uint64_t step);
#define LIBCAMERA_DISABLE_COPY(klass)
Disable copy construction and assignment of the klass.
Helper class for dma-buf allocations.
Definition: dma_buf_allocator.h:23
bool isValid() const
Check if the DmaBufAllocator instance is valid.
Definition: dma_buf_allocator.h:35
int exportBuffers(unsigned int count, const std::vector< unsigned int > &planeSizes, std::vector< std::unique_ptr< FrameBuffer > > *buffers)
Allocate and export buffers from the DmaBufAllocator.
Definition: dma_buf_allocator.cpp:223
DmaBufAllocator(DmaBufAllocatorFlags flags=DmaBufAllocatorFlag::CmaHeap)
Construct a DmaBufAllocator of a given type.
Definition: dma_buf_allocator.cpp:97
DmaBufAllocatorFlag
Type of the dma-buf provider.
Definition: dma_buf_allocator.h:25
@ CmaHeap
Allocate from a CMA dma-heap, providing physically-contiguous memory.
~DmaBufAllocator()
Destroy the DmaBufAllocator instance.
UniqueFD alloc(const char *name, std::size_t size)
Allocate a dma-buf from the DmaBufAllocator.
Definition: dma_buf_allocator.cpp:200
Helper class for dma-buf's synchronization.
Definition: dma_buf_allocator.h:53
SyncType
Read and/or write access via the CPU map.
Definition: dma_buf_allocator.h:55
@ ReadWrite
Indicates that the mapped dma-buf will be read and written by the client via the CPU map.
DmaSyncer & operator=(DmaSyncer &&other)=default
Enable move on class DmaSyncer.
DmaSyncer(DmaSyncer &&other)=default
Enable move on class DmaSyncer.
DmaSyncer(SharedFD fd, SyncType type=SyncType::ReadWrite)
Construct a DmaSyncer with a dma-buf's fd and the access type.
Definition: dma_buf_allocator.cpp:296
Type-safe container for enum-based bitfields.
Definition: flags.h:16
RAII-style wrapper for file descriptors.
Definition: shared_fd.h:17
unique_ptr-like wrapper for a file descriptor
Definition: unique_fd.h:18
bool isValid() const
Check if the UniqueFD owns a valid file descriptor.
Definition: unique_fd.h:61
#define LIBCAMERA_FLAGS_ENABLE_OPERATORS(_enum)
Enable bitwise operations on the enum enumeration.
Top-level libcamera namespace.
Definition: backtrace.h:17
File descriptor wrapper that owns a file descriptor.