libcamera
v0.4.0+56-9b1f609e
Supporting cameras in Linux since 2019
|
Registration of ConverterFactory classes and creation of instances. More...
Public Member Functions | |
ConverterFactory (const char *name, std::initializer_list< std::string > compatibles) | |
Construct a converter factory. More... | |
std::unique_ptr< Converter > | createInstance (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< Converter > | create (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... | |
Registration of ConverterFactory classes and creation of instances.
_Converter | The 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.
|
inline |
Construct a converter factory.
[in] | name | Name of the converter class |
[in] | compatibles | Name 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.
|
inlineoverridevirtual |
Create an instance of the Converter corresponding to the factory.
[in] | media | Media device pointer |
Implements libcamera::ConverterFactoryBase.