libcamera  v0.5.0
Supporting cameras in Linux since 2019
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | List of all members
libcamera::DmaSyncer Class Referencefinal

Helper class for dma-buf's synchronization. More...

Public Types

enum  SyncType { SyncType::Read = 0, SyncType::Write, SyncType::ReadWrite }
 Read and/or write access via the CPU map. More...
 

Public Member Functions

 DmaSyncer (SharedFD fd, SyncType type=SyncType::ReadWrite)
 Construct a DmaSyncer with a dma-buf's fd and the access type. More...
 
 DmaSyncer (DmaSyncer &&other)=default
 Enable move on class DmaSyncer. More...
 
DmaSynceroperator= (DmaSyncer &&other)=default
 Enable move on class DmaSyncer. More...
 

Detailed Description

Helper class for dma-buf's synchronization.

This class wraps a userspace dma-buf's synchronization process with an object's lifetime.

It's used when the user needs to access a dma-buf with CPU, mostly mapped with MappedFrameBuffer, so that the buffer is synchronized between CPU and ISP.

Member Enumeration Documentation

◆ SyncType

Read and/or write access via the CPU map.

Enumerator
Read 

Indicates that the mapped dma-buf will be read by the client via the CPU map.

Write 

Indicates that the mapped dm-buf will be written by the client via the CPU map.

ReadWrite 

Indicates that the mapped dma-buf will be read and written by the client via the CPU map.

Constructor & Destructor Documentation

◆ DmaSyncer() [1/2]

libcamera::DmaSyncer::DmaSyncer ( SharedFD  fd,
SyncType  type = SyncType::ReadWrite 
)
explicit

Construct a DmaSyncer with a dma-buf's fd and the access type.

Parameters
[in]fdThe dma-buf's file descriptor to synchronize
[in]typeRead and/or write access via the CPU map

◆ DmaSyncer() [2/2]

libcamera::DmaSyncer::DmaSyncer ( DmaSyncer &&  other)
default

Enable move on class DmaSyncer.

Parameters
[in]otherThe other instance

Member Function Documentation

◆ operator=()

libcamera::DmaSyncer::operator= ( DmaSyncer &&  other)
default

Enable move on class DmaSyncer.

Parameters
[in]otherThe other instance

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