libcamera  v0.3.1+12-19bbca3c
Supporting cameras in Linux since 2019
Public Member Functions | Static Public Member Functions | List of all members
libcamera::ConverterFactoryBase Class Referenceabstract

Base class for converter factories. More...

Inheritance diagram for libcamera::ConverterFactoryBase:
Inheritance graph
[legend]

Public Member Functions

 ConverterFactoryBase (const std::string name, std::initializer_list< std::string > compatibles)
 Construct a converter factory base. More...
 
const std::vector< std::string > & compatibles () const
 

Static Public Member Functions

static std::unique_ptr< Convertercreate (MediaDevice *media)
 Create an instance of the converter corresponding to the media device. More...
 
static std::vector< ConverterFactoryBase * > & factories ()
 Retrieve the list of all converter factories. More...
 
static std::vector< std::string > names ()
 Retrieve the list of all converter factory names. More...
 

Detailed Description

Base class for converter factories.

The ConverterFactoryBase class is the base of all specializations of the ConverterFactory class template. It implements the factory registration, maintains a registry of factories, and provides access to the registered factories.

Constructor & Destructor Documentation

◆ ConverterFactoryBase()

libcamera::ConverterFactoryBase::ConverterFactoryBase ( const std::string  name,
std::initializer_list< std::string >  compatibles 
)

Construct a converter factory base.

Parameters
[in]nameName of the converter class
[in]compatiblesName aliases of the converter class

Creating an instance of the factory base registers it with the global list of factories, accessible through the factories() function.

The factory name is used as unique identifier. If the converter implementation fully relies on a generic framework, the name should be the same as the framework. Otherwise, if the implementation is specialized, the factory name should match the driver name implementing the function.

The factory compatibles holds a list of driver names implementing a generic subsystem without any personalizations.

Member Function Documentation

◆ compatibles()

libcamera::ConverterFactoryBase::compatibles ( ) const
inline
Returns
The list of compatible name aliases of the converter

◆ create()

std::unique_ptr< Converter > libcamera::ConverterFactoryBase::create ( MediaDevice media)
static

Create an instance of the converter corresponding to the media device.

Parameters
[in]mediaThe media device to create the converter for

The converter is created by matching the factory name or any of its compatible aliases with the media device driver name.

Returns
A new instance of the converter subclass corresponding to the media device, or null if the media device driver name doesn't match anything

◆ factories()

std::vector< ConverterFactoryBase * > & libcamera::ConverterFactoryBase::factories ( )
static

Retrieve the list of all converter factories.

Returns
The list of converter factories

◆ names()

std::vector< std::string > libcamera::ConverterFactoryBase::names ( )
static

Retrieve the list of all converter factory names.

Returns
The list of all converter factory names

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