|
libcamera v0.7.2
Supporting cameras in Linux since 2019
|
Frame buffer data and its associated dynamic metadata. More...
Classes | |
| struct | Plane |
| A memory region to store a single plane of a frame. More... | |
Public Member Functions | |
| FrameBuffer (Span< const Plane > planes, unsigned int cookie=0) | |
| Construct a FrameBuffer with an array of planes. | |
| FrameBuffer (std::unique_ptr< Private > d) | |
| Construct a FrameBuffer with an extensible private class. | |
| Span< const Plane > | planes () const |
| Retrieve the static plane descriptors. | |
| Request * | request () const |
| Retrieve the request this buffer belongs to. | |
| const FrameMetadata & | metadata () const |
| Retrieve the dynamic metadata. | |
| uint64_t | cookie () const |
| Retrieve the cookie. | |
| void | setCookie (uint64_t cookie) |
| Set the cookie. | |
| std::unique_ptr< Fence > | releaseFence () |
| Extract the Fence associated with this Framebuffer. | |
Frame buffer data and its associated dynamic metadata.
The FrameBuffer class is the primary interface for applications, IPAs and pipeline handlers to interact with frame memory. It contains all the static and dynamic information to manage the whole life cycle of a frame capture, from buffer creation to consumption.
The static information describes the memory planes that make a frame. The planes are specified when creating the FrameBuffer and are expressed as a set of dmabuf file descriptors, offset and length.
The dynamic information is grouped in a FrameMetadata instance. It is updated during the processing of a queued capture request, and is valid from the completion of the buffer as signaled by Camera::bufferComplete() until the FrameBuffer is either reused in a new request or deleted.
| libcamera::FrameBuffer::FrameBuffer | ( | Span< const Plane > | planes, |
| unsigned int | cookie = 0 ) |
Construct a FrameBuffer with an array of planes.
| libcamera::FrameBuffer::FrameBuffer | ( | std::unique_ptr< Private > | d | ) |
Construct a FrameBuffer with an extensible private class.
| [in] | d | The extensible private class |
| uint64_t libcamera::FrameBuffer::cookie | ( | ) | const |
| const FrameMetadata & libcamera::FrameBuffer::metadata | ( | ) | const |
Retrieve the dynamic metadata.
| Span< const FrameBuffer::Plane > libcamera::FrameBuffer::planes | ( | ) | const |
Retrieve the static plane descriptors.
| std::unique_ptr< Fence > libcamera::FrameBuffer::releaseFence | ( | ) |
Extract the Fence associated with this Framebuffer.
This function moves the buffer's fence ownership to the caller. After the fence has been released, calling this function always return nullptr.
If buffer with a Fence completes with errors due to a failure in handling the fence, applications are responsible for releasing the Fence before calling Request::addBuffer() again.
| Request * libcamera::FrameBuffer::request | ( | ) | const |
Retrieve the request this buffer belongs to.
The intended callers of this function are buffer completion handlers that need to associate a buffer to the request it belongs to.
A FrameBuffer is associated to a request by Request::addBuffer() and the association is valid until the buffer completes. The returned request pointer is valid only during that interval.
| void libcamera::FrameBuffer::setCookie | ( | uint64_t | cookie | ) |
Set the cookie.
| [in] | cookie | Cookie to set |
The creator (and only the creator) of the FrameBuffer may store an arbitrary 64-bit integer value in the FrameBuffer, this value is called the cookie. It may be retrieved or set at any time, and is guaranteed not to be modified by the libcamera core. This mechanism is similar to the Request cookie.
An application using a FrameBufferAllocator is considered to be the creator of the allocated FrameBuffer objects, and thus it may manage the cookie as it sees fit.