summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Semkowicz <dse@thaumatec.com>2022-06-17 16:35:48 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-06-17 18:08:53 +0300
commitd85a91cf56a68cea30019362f1206dcebce3db23 (patch)
treebe777654d3c19120b2d62c364f236f868def3a7f
parent14ae86f0c92192f8da8a566bbe488e541af14ee9 (diff)
Documentation: Update code examples to use the Request::reuse() method
After introduction of reuse(), there is no need of manual request reconfiguration. Furthermore, current example code does not work anymore. Signed-off-by: Daniel Semkowicz <dse@thaumatec.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--Documentation/guides/application-developer.rst20
1 files changed, 3 insertions, 17 deletions
diff --git a/Documentation/guides/application-developer.rst b/Documentation/guides/application-developer.rst
index fd6cd3d9..b97047cd 100644
--- a/Documentation/guides/application-developer.rst
+++ b/Documentation/guides/application-developer.rst
@@ -480,26 +480,12 @@ libcamera repository.
.. _FileSink class: https://git.libcamera.org/libcamera/libcamera.git/tree/src/cam/file_sink.cpp
With the handling of this request completed, it is possible to re-use the
-buffers by adding them to a new ``Request`` instance with their matching
-streams, and finally, queue the new capture request to the camera device:
+request and the associated buffers and re-queue it to the camera
+device:
.. code:: cpp
- request = camera->createRequest();
- if (!request)
- {
- std::cerr << "Can't create request" << std::endl;
- return;
- }
-
- for (auto it = buffers.begin(); it != buffers.end(); ++it)
- {
- Stream *stream = it->first;
- FrameBuffer *buffer = it->second;
-
- request->addBuffer(stream, buffer);
- }
-
+ request->reuse(Request::ReuseBuffers);
camera->queueRequest(request);
Request queueing