libcamera
v0.0.0
Supporting cameras in Linux since 2019
|
A frame capture request. More...
Public Types | |
enum | Status { RequestPending , RequestComplete , RequestCancelled } |
Public Member Functions | |
Request (Camera *camera, uint64_t cookie=0) | |
Create a capture request for a camera. More... | |
Request (const Request &)=delete | |
Request & | operator= (const Request &)=delete |
ControlList & | controls () |
Retrieve the request's ControlList. More... | |
ControlList & | metadata () |
Retrieve the request's metadata. More... | |
const std::map< Stream *, FrameBuffer * > & | buffers () const |
Retrieve the request's streams to buffers map. More... | |
int | addBuffer (Stream *stream, FrameBuffer *buffer) |
Add a FrameBuffer with its associated Stream to the Request. More... | |
FrameBuffer * | findBuffer (Stream *stream) const |
Return the buffer associated with a stream. More... | |
uint64_t | cookie () const |
Retrieve the cookie set when the request was created. More... | |
Status | status () const |
Retrieve the request completion status. More... | |
bool | hasPendingBuffers () const |
Check if a request has buffers yet to be completed. More... | |
Friends | |
class | PipelineHandler |
A frame capture request.
A Request allows an application to associate buffers and controls on a per-frame basis to be queued to the camera device for processing.
Request completion status
Enumerator | |
---|---|
RequestPending | The request hasn't completed yet |
RequestComplete | The request has completed |
RequestCancelled | The request has been cancelled due to capture stop |
libcamera::Request::Request | ( | Camera * | camera, |
uint64_t | cookie = 0 |
||
) |
Create a capture request for a camera.
[in] | camera | The camera that creates the request |
[in] | cookie | Opaque cookie for application use |
The cookie is stored in the request and is accessible through the cookie() method at any time. It is typically used by applications to map the request to an external resource in the request completion handler, and is completely opaque to libcamera.
int libcamera::Request::addBuffer | ( | Stream * | stream, |
FrameBuffer * | buffer | ||
) |
Add a FrameBuffer with its associated Stream to the Request.
[in] | stream | The stream the buffer belongs to |
[in] | buffer | The FrameBuffer to add to the request |
A reference to the buffer is stored in the request. The caller is responsible for ensuring that the buffer will remain valid until the request complete callback is called.
A request can only contain one buffer per stream. If a buffer has already been added to the request for the same stream, this method returns -EEXIST.
-EEXIST | The request already contains a buffer for the stream |
-EINVAL | The buffer does not reference a valid Stream |
|
inline |
Retrieve the request's streams to buffers map.
Return a reference to the map that associates each Stream part of the request to the FrameBuffer the Stream output should be directed to.
|
inline |
Retrieve the request's ControlList.
Requests store a list of controls to be applied to all frames captured for the request. They are created with an empty list of controls that can be accessed through this method and updated with ControlList::operator[]() or ControlList::update().
Only controls supported by the camera to which this request will be submitted shall be included in the controls list. Attempting to add an unsupported control causes undefined behaviour.
|
inline |
Retrieve the cookie set when the request was created.
FrameBuffer * libcamera::Request::findBuffer | ( | Stream * | stream | ) | const |
Return the buffer associated with a stream.
[in] | stream | The stream the buffer is associated to |
|
inline |
Check if a request has buffers yet to be completed.
|
inline |
Retrieve the request's metadata.
|
inline |
Retrieve the request completion status.
The request status indicates whether the request has completed successfully or with an error. When requests are created and before they complete the request status is set to RequestPending, and is updated at completion time to RequestComplete. If a request is cancelled at capture stop before it has completed, its status is set to RequestCancelled.