mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
Documentation: Fix createRequest unique_ptr
camera->createRequest() function return std::unique_ptr<Request>, then
manipulate Request as std::unique_ptr.
This solve the following error, during compilation:
error: cannot convert ‘std::unique_ptr<libcamera::Request>’ to ‘libcamera::Request*’ in initialization
References:
- bb97f3bbd9/simple-cam.cpp (L369)
Signed-off-by: Tommaso Merciai <tommaso.merciai@amarulasolutions.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
71bdc1e441
commit
f44ce70d9b
1 changed files with 5 additions and 5 deletions
|
@ -308,7 +308,7 @@ the camera.
|
||||||
|
|
||||||
Stream *stream = streamConfig.stream();
|
Stream *stream = streamConfig.stream();
|
||||||
const std::vector<std::unique_ptr<FrameBuffer>> &buffers = allocator->buffers(stream);
|
const std::vector<std::unique_ptr<FrameBuffer>> &buffers = allocator->buffers(stream);
|
||||||
std::vector<Request *> requests;
|
std::vector<std::unique_ptr<Request>> requests;
|
||||||
|
|
||||||
Proceed to fill the request vector by creating ``Request`` instances from the
|
Proceed to fill the request vector by creating ``Request`` instances from the
|
||||||
camera device, and associate a buffer for each of them for the ``Stream``.
|
camera device, and associate a buffer for each of them for the ``Stream``.
|
||||||
|
@ -316,7 +316,7 @@ camera device, and associate a buffer for each of them for the ``Stream``.
|
||||||
.. code:: cpp
|
.. code:: cpp
|
||||||
|
|
||||||
for (unsigned int i = 0; i < buffers.size(); ++i) {
|
for (unsigned int i = 0; i < buffers.size(); ++i) {
|
||||||
Request *request = camera->createRequest();
|
std::unique_ptr<Request> request = camera->createRequest();
|
||||||
if (!request)
|
if (!request)
|
||||||
{
|
{
|
||||||
std::cerr << "Can't create request" << std::endl;
|
std::cerr << "Can't create request" << std::endl;
|
||||||
|
@ -332,7 +332,7 @@ camera device, and associate a buffer for each of them for the ``Stream``.
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
requests.push_back(request);
|
requests.push_back(std::move(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
.. TODO: Controls
|
.. TODO: Controls
|
||||||
|
@ -517,8 +517,8 @@ and queue all the previously created requests.
|
||||||
.. code:: cpp
|
.. code:: cpp
|
||||||
|
|
||||||
camera->start();
|
camera->start();
|
||||||
for (Request *request : requests)
|
for (std::unique_ptr<Request> &request : requests)
|
||||||
camera->queueRequest(request);
|
camera->queueRequest(request.get());
|
||||||
|
|
||||||
Start an event loop
|
Start an event loop
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue