[libcamera-devel] [SimpleCam PATCH 3/4] simple-cam: Fix the Buffer Allocation guidance

Kieran Bingham kieran.bingham at ideasonboard.com
Tue Aug 24 16:24:49 CEST 2021


The Buffer Allocation notes contains a TODO. Improve the notes regarding
the FrameBufferAllocation and remove the todo.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 simple-cam.cpp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/simple-cam.cpp b/simple-cam.cpp
index 2e646a5485c9..47c5dc9987bc 100644
--- a/simple-cam.cpp
+++ b/simple-cam.cpp
@@ -274,10 +274,16 @@ 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. We need to provide buffers to store
+	 * captured images in. An application might choose to provide buffers
+	 * externally, for instance from a display driver which will render the
+	 * captured images, however libcamera can also provide buffers from a
+	 * configured camera.
+	 *
+	 * To request buffers from libcamera, we use the FrameBufferAllocator,
+	 * and reference the (configured) camera for which we wish to allocate
+	 * buffers for.
 	 */
-	/* TODO: Update the comment here too */
 	FrameBufferAllocator *allocator = new FrameBufferAllocator(camera);
 
 	for (StreamConfiguration &cfg : *config) {
-- 
2.30.2



More information about the libcamera-devel mailing list