[libcamera-devel] [PATCH 2/3] Documentation: application-developer: Elaborate on request reuse

Paul Elder paul.elder at ideasonboard.com
Tue Dec 13 10:38:01 CET 2022


It recently came to our attention that marking a Request for reuse and
*not* queueing it causes segfaults at Request deallocation time, if it
happens after framebuffer deallocation. Add a note to warn against this
in the application-developer documentation.

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
 Documentation/guides/application-developer.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst
index 1b2d7727..26d5fc1d 100644
--- a/Documentation/guides/application-developer.rst
+++ b/Documentation/guides/application-developer.rst
@@ -490,6 +490,10 @@ device:
    request->reuse(Request::ReuseBuffers);
    camera->queueRequest(request);
 
+Note that a request should only be marked for re-use if and only if the request
+will be re-queued to the camera device. Marking a request for re-use and not
+queuing it causes undefined behavior.
+
 Request queueing
 ----------------
 
-- 
2.35.1



More information about the libcamera-devel mailing list