libcamera  v0.2.0+150-2031e2f2
Supporting cameras in Linux since 2019
Public Member Functions | List of all members
libcamera::ConverterFactory< _Converter > Class Template Reference

Registration of ConverterFactory classes and creation of instances. More...

Inheritance diagram for libcamera::ConverterFactory< _Converter >:
Inheritance graph
[legend]
Collaboration diagram for libcamera::ConverterFactory< _Converter >:
Collaboration graph
[legend]

Public Member Functions

 ConverterFactory (const char *name, std::initializer_list< std::string > compatibles)
 Construct a converter factory. More...
 
std::unique_ptr< ConvertercreateInstance (MediaDevice *media) const override
 Create an instance of the Converter corresponding to the factory. More...
 
- Public Member Functions inherited from libcamera::ConverterFactoryBase
 ConverterFactoryBase (const std::string name, std::initializer_list< std::string > compatibles)
 Construct a converter factory base. More...
 
const std::vector< std::string > & compatibles () const
 

Additional Inherited Members

- Static Public Member Functions inherited from libcamera::ConverterFactoryBase
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

template<typename _Converter>
class libcamera::ConverterFactory< _Converter >

Registration of ConverterFactory classes and creation of instances.

Parameters
_ConverterThe converter class type for this factory

To facilitate discovery and instantiation of Converter classes, the ConverterFactory class implements auto-registration of converter helpers. Each Converter subclass shall register itself using the REGISTER_CONVERTER() macro, which will create a corresponding instance of a ConverterFactory subclass and register it with the static list of factories.

Constructor & Destructor Documentation

◆ ConverterFactory()

template<typename _Converter >
libcamera::ConverterFactory< _Converter >::ConverterFactory ( const char *  name,
std::initializer_list< std::string >  compatibles 
)
inline

Construct a converter factory.

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

◆ createInstance()

template<typename _Converter >
libcamera::ConverterFactory< _Converter >::createInstance ( MediaDevice media) const
inlineoverridevirtual

Create an instance of the Converter corresponding to the factory.

Parameters
[in]mediaMedia device pointer
Returns
A unique pointer to a newly constructed instance of the Converter subclass corresponding to the factory

Implements libcamera::ConverterFactoryBase.


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