libcamera  v0.3.2+116-83c5ad0f
Supporting cameras in Linux since 2019
Public Attributes | Static Public Attributes | List of all members
libcamera::FrameBuffer::Plane Struct Reference

A memory region to store a single plane of a frame. More...

Collaboration diagram for libcamera::FrameBuffer::Plane:
Collaboration graph
[legend]

Public Attributes

SharedFD fd
 The dmabuf file descriptor.
 
unsigned int offset = kInvalidOffset
 The plane offset in bytes.
 
unsigned int length
 The plane length in bytes.
 

Static Public Attributes

static constexpr unsigned int kInvalidOffset = std::numeric_limits<unsigned int>::max()
 Invalid offset value, to identify uninitialized planes.
 

Detailed Description

A memory region to store a single plane of a frame.

Planar pixel formats use multiple memory regions to store the different colour components of a frame. The Plane structure describes such a memory region by a dmabuf file descriptor, an offset within the dmabuf and a length. A FrameBuffer then contains one or multiple planes, depending on the pixel format of the frames it is meant to store.

The offset identifies the location of the plane data from the start of the memory referenced by the dmabuf file descriptor. Multiple planes may be stored in the same dmabuf, in which case they will reference the same dmabuf and different offsets. No two planes may overlap, as specified by their offset and length.

To support DMA access, planes are associated with dmabuf objects represented by SharedFD handles. The Plane class doesn't handle mapping of the memory to the CPU, but applications and IPAs may use the dmabuf file descriptors to map the plane memory with mmap() and access its contents.

Todo:
Specify how an application shall decide whether to use a single or multiple dmabufs, based on the camera requirements.

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