From eaf55054b5a160e263e497750e66fea4c41da0df Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 23 Aug 2021 15:35:52 +0100 Subject: simple-cam: Fix the Buffer Allocation guidance The Buffer Allocation notes contains a TODO. Improve the notes regarding the FrameBufferAllocation and remove the todo. Reviewed-by: Jacopo Mondi Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- simple-cam.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/simple-cam.cpp b/simple-cam.cpp index 2e646a5..735e6bf 100644 --- a/simple-cam.cpp +++ b/simple-cam.cpp @@ -274,10 +274,22 @@ int main() * Buffer Allocation * * Now that a camera has been configured, it knows all about its - * Streams sizes and formats, so we now have to ask it to reserve - * memory for all of them. + * Streams sizes and formats. The captured images need to be stored in + * framebuffers which can either be provided by the application to the + * library, or allocated in the Camera and exposed to the application + * by libcamera. + * + * An application may decide to allocate framebuffers from elsewhere, + * for example in memory allocated by the display driver that will + * render the captured frames. The application will provide them to + * libcamera by constructing FrameBuffer instances to capture images + * directly into. + * + * Alternatively libcamera can help the application by exporting + * buffers allocated in the Camera using a FrameBufferAllocator + * instance and referencing a configured Camera to determine the + * appropriate buffer size and types to create. */ - /* TODO: Update the comment here too */ FrameBufferAllocator *allocator = new FrameBufferAllocator(camera); for (StreamConfiguration &cfg : *config) { -- cgit v1.2.1