libcamera
v0.4.0
Supporting cameras in Linux since 2019
|
Public Member Functions | |
Private (Camera *camera) | |
Create a Request::Private. More... | |
Camera * | camera () const |
Retrieve the camera this request has been queued to. More... | |
bool | hasPendingBuffers () const |
Check if a request has buffers yet to be completed. More... | |
bool | completeBuffer (FrameBuffer *buffer) |
Complete a buffer for the request. More... | |
void | complete () |
Complete a queued request. More... | |
void | cancel () |
Cancel a queued request. More... | |
void | reset () |
Reset the request internal data to default values. More... | |
void | prepare (std::chrono::milliseconds timeout=0ms) |
Prepare the Request to be queued to the device. More... | |
Public Member Functions inherited from libcamera::Extensible::Private | |
Private () | |
Construct an instance of an Extensible class private data. | |
Public Attributes | |
Signal | prepared |
Request preparation completed Signal. More... | |
Friends | |
class | PipelineHandler |
std::ostream & | operator<< (std::ostream &out, const Request &r) |
Insert a text representation of a Request into an output stream. More... | |
Request private data.
The Request::Private class stores all private data associated with a request. It implements the d-pointer design pattern to hide core Request data from the public API, and exposes utility functions to internal users of the request (namely the PipelineHandler class and its subclasses).
libcamera::Request::Private::Private | ( | Camera * | camera | ) |
Create a Request::Private.
camera | The Camera that creates the request |
|
inline |
Retrieve the camera this request has been queued to.
void libcamera::Request::Private::cancel | ( | ) |
Cancel a queued request.
Mark the request and its associated buffers as cancelled and complete it.
Set each pending buffer in error state and emit the buffer completion signal before completing the Request.
void libcamera::Request::Private::complete | ( | ) |
Complete a queued request.
Mark the request as complete by updating its status to RequestComplete, unless buffers have been cancelled in which case the status is set to RequestCancelled.
bool libcamera::Request::Private::completeBuffer | ( | FrameBuffer * | buffer | ) |
Complete a buffer for the request.
[in] | buffer | The buffer that has completed |
A request tracks the status of all buffers it contains through a set of pending buffers. This function removes the buffer from the set to mark it as complete. All buffers associate with the request shall be marked as complete by calling this function once and once only before reporting the request as complete with the complete() function.
bool libcamera::Request::Private::hasPendingBuffers | ( | ) | const |
Check if a request has buffers yet to be completed.
void libcamera::Request::Private::prepare | ( | std::chrono::milliseconds | timeout = 0ms | ) |
Prepare the Request to be queued to the device.
[in] | timeout | Optional expiration timeout |
Prepare a Request to be queued to the hardware device by ensuring it is ready for the incoming memory transfers.
This currently means waiting on each frame buffer acquire fence to be signalled. An optional expiration timeout can be specified. If not all the fences have been signalled correctly before the timeout expires the Request is cancelled.
The function immediately emits the prepared signal if all the prepare operations have been completed synchronously. If instead the prepare operations require to wait the completion of asynchronous events, such as fences notifications or timer expiration, the prepared signal is emitted upon the asynchronous event completion.
As we currently only handle fences, the function emits the prepared signal immediately if there are no fences to wait on. Otherwise the prepared signal is emitted when all fences have been signalled or the optional timeout has expired.
If not all the fences have been correctly signalled or the optional timeout has expired the Request will be cancelled and the Request::prepared signal emitted.
The intended user of this function is the PipelineHandler base class, which 'prepares' a Request before queuing it to the hardware device.
void libcamera::Request::Private::reset | ( | ) |
Reset the request internal data to default values.
After calling this function, all request internal data will have default values as if the Request::Private instance had just been constructed.
|
friend |
libcamera::Request::Private::prepared |
Request preparation completed Signal.
The signal is emitted once the request preparation has completed and is ready to be queued. The Request might complete with errors in which case it is cancelled.
The intended slot for this signal is the PipelineHandler::doQueueRequests() function which queues Request after they have been prepared or cancel them if they have failed preparing.