Loading...
Searching...
No Matches
libcamera::ConverterFactoryBase Class Referenceabstract

Base class for converter factories. More...

Inheritance diagram for libcamera::ConverterFactoryBase:
[legend]

## Public Member Functions

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

## Static Public Member Functions

static std::unique_ptr< Converter > | create (std::shared_ptr< 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

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

## compatibles()

const std::vector< std::string > & libcamera::ConverterFactoryBase::compatibles | ( |  | ) | const

inline

Returns
  The list of compatible name aliases of the converter

## create()

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

static

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

Parameters

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

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