libcamera  v0.3.2+116-83c5ad0f
Supporting cameras in Linux since 2019
Public Member Functions | List of all members
libcamera::FrameBuffer::Private Class Reference

Base class for FrameBuffer private data. More...

Inheritance diagram for libcamera::FrameBuffer::Private:
Inheritance graph
[legend]
Collaboration diagram for libcamera::FrameBuffer::Private:
Collaboration graph
[legend]

Public Member Functions

 Private (const std::vector< Plane > &planes, uint64_t cookie=0)
 Construct a FrameBuffer::Private instance. More...
 
virtual ~Private ()
 FrameBuffer::Private destructor.
 
void setRequest (Request *request)
 Set the request this buffer belongs to. More...
 
bool isContiguous () const
 Check if the frame buffer stores planes contiguously in memory. More...
 
Fencefence () const
 Retrieve a const pointer to the Fence. More...
 
void setFence (std::unique_ptr< Fence > fence)
 Move a fence in this buffer. More...
 
void cancel ()
 Marks the buffer as cancelled. More...
 
FrameMetadatametadata ()
 Retrieve the dynamic metadata. More...
 
- Public Member Functions inherited from libcamera::Extensible::Private
 Private ()
 Construct an instance of an Extensible class private data.
 

Detailed Description

Base class for FrameBuffer private data.

The FrameBuffer::Private class stores all private data associated with a framebuffer. It implements the d-pointer design pattern to hide core FrameBuffer data from the public API, and exposes utility functions to pipeline handlers.

Constructor & Destructor Documentation

◆ Private()

libcamera::FrameBuffer::Private::Private ( const std::vector< Plane > &  planes,
uint64_t  cookie = 0 
)

Construct a FrameBuffer::Private instance.

Parameters
[in]planesThe frame memory planes
[in]cookieCookie

Member Function Documentation

◆ cancel()

libcamera::FrameBuffer::Private::cancel ( )
inline

Marks the buffer as cancelled.

If a buffer is not used by a request, it shall be marked as cancelled to indicate that the metadata is invalid.

◆ fence()

libcamera::FrameBuffer::Private::fence ( ) const
inline

Retrieve a const pointer to the Fence.

This function does only return a reference to the the fence and does not change its ownership. The fence is stored in the FrameBuffer and can only be reset with FrameBuffer::releaseFence() in case the buffer has completed with error due to a Fence wait failure.

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.

See also
Request::addBuffer()
Returns
A const pointer to the Fence if any, nullptr otherwise

◆ isContiguous()

libcamera::FrameBuffer::Private::isContiguous ( ) const
inline

Check if the frame buffer stores planes contiguously in memory.

Multi-planar frame buffers can store their planes contiguously in memory, or split them into discontiguous memory areas. This function checks in which of these two categories the frame buffer belongs.

Returns
True if the planes are stored contiguously in memory, false otherwise

◆ metadata()

libcamera::FrameBuffer::Private::metadata ( )
inline

Retrieve the dynamic metadata.

Returns
Dynamic metadata for the frame contained in the buffer

◆ setFence()

libcamera::FrameBuffer::Private::setFence ( std::unique_ptr< Fence fence)
inline

Move a fence in this buffer.

Parameters
[in]fenceThe Fence

This function associates a Fence with this Framebuffer. The intended caller is the Request::addBuffer() function.

Once a FrameBuffer is associated with a Fence, the FrameBuffer will only be made available to the hardware device once the Fence has been correctly signalled.

See also
Request::prepare()

If the FrameBuffer completes successfully the core releases the Fence and the Buffer can be reused immediately. If handling of the Fence fails during the request preparation, the Fence is not released and is left in the FrameBuffer. It is applications responsibility to correctly release the fence and handle it opportunely before using the buffer again.

◆ setRequest()

libcamera::FrameBuffer::Private::setRequest ( Request request)
inline

Set the request this buffer belongs to.

Parameters
[in]requestRequest to set

For buffers added to requests by applications, this function is called by Request::addBuffer() or Request::reuse(). For buffers internal to pipeline handlers, it is called by the pipeline handlers themselves.


The documentation for this class was generated from the following files: