From 168488275aacc804ffd264187dca8b3e48b21d9e Mon Sep 17 00:00:00 2001 From: Harvey Yang Date: Tue, 22 Oct 2024 07:43:37 +0000 Subject: libcamera: add DmaBufAllocator::exportBuffers() Add a helper function exportBuffers in DmaBufAllocator to make it easier to use. It'll be used in Virtual Pipeline Handler and SoftwareIsp. Signed-off-by: Harvey Yang Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi Signed-off-by: Kieran Bingham --- include/libcamera/internal/dma_buf_allocator.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/dma_buf_allocator.h b/include/libcamera/internal/dma_buf_allocator.h index d2a0a0d1..9211d483 100644 --- a/include/libcamera/internal/dma_buf_allocator.h +++ b/include/libcamera/internal/dma_buf_allocator.h @@ -7,11 +7,17 @@ #pragma once +#include +#include +#include + #include #include namespace libcamera { +class FrameBuffer; + class DmaBufAllocator { public: @@ -28,7 +34,14 @@ public: bool isValid() const { return providerHandle_.isValid(); } UniqueFD alloc(const char *name, std::size_t size); + int exportBuffers(unsigned int count, + const std::vector &planeSizes, + std::vector> *buffers); + private: + std::unique_ptr createBuffer( + std::string name, const std::vector &planeSizes); + UniqueFD allocFromHeap(const char *name, std::size_t size); UniqueFD allocFromUDmaBuf(const char *name, std::size_t size); UniqueFD providerHandle_; -- cgit v1.2.1