libcamera: libcamera::ConverterFactory< _Converter > Class Template Reference

libcamera v0.5.1 Supporting cameras in Linux since 2019

Loading...
Searching...
No Matches
libcamera::ConverterFactory< _Converter > Class Template Reference

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

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

## Public Member Functions
| ConverterFactory (const char *name, std::initializer_list< std::string > compatibles)
| Construct a converter factory.
std::unique_ptr< Converter > | createInstance (MediaDevice *media) const override
| Create an instance of the Converter corresponding to the factory.
Public Member Functions inherited from libcamera::ConverterFactoryBase
| ConverterFactoryBase (const std::string name, std::initializer_list< std::string > compatibles)
| Construct a converter factory base.
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.
static std::vector< ConverterFactoryBase * > & | factories ()
| Retrieve the list of all converter factories.
static std::vector< std::string > | names ()
| Retrieve the list of all converter factory names.

## Detailed Description

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

Registration of ConverterFactory classes and creation of instances.

Parameters

  _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.

## 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] | 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.

## Member Function Documentation

## ◆ createInstance()

template<typename _Converter>

std::unique_ptr< Converter > libcamera::ConverterFactory< _Converter >::createInstance | ( | MediaDevice * | media | ) | const
| inlineoverridevirtual

Create an instance of the Converter corresponding to the factory.

Parameters

  [in] | media | Media 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:

- include/libcamera/internal/converter.h
- src/libcamera/converter.cpp