libcamera::PipelineHandlerFactory Class Referenceabstract

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

## Public Member Functions

| PipelineHandlerFactory (const char *name)
| Construct a pipeline handler factory. More...
std::shared_ptr< PipelineHandler > | create (CameraManager *manager)
| Create an instance of the PipelineHandler corresponding to the factory. More...
const std::string & | name () const
| Retrieve the factory name. More...

## Static Public Member Functions

static void | registerType (PipelineHandlerFactory *factory)
| Add a pipeline handler class to the registry. More...
static std::vector< PipelineHandlerFactory * > & | factories ()
| Retrieve the list of all pipeline handler factories. More...

## Detailed Description

Registration of PipelineHandler classes and creation of instances.

To facilitate discovery and instantiation of PipelineHandler classes, the PipelineHandlerFactory class maintains a registry of pipeline handler classes. Each PipelineHandler subclass shall register itself using the REGISTER_PIPELINE_HANDLER() macro, which will create a corresponding instance of a PipelineHandlerFactory subclass and register it with the static list of factories.

## Constructor & Destructor Documentation

## PipelineHandlerFactory()

libcamera::PipelineHandlerFactory::PipelineHandlerFactory | ( | const char * | name | ) |

Construct a pipeline handler factory.

Parameters

  [in] | name | Name of the pipeline handler class

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

The factory name is used for debug purpose and shall be unique.

## Member Function Documentation

## create()

std::shared_ptr< PipelineHandler > libcamera::PipelineHandlerFactory::create | ( | CameraManager * | manager | ) |

Create an instance of the PipelineHandler corresponding to the factory.

Parameters

  [in] | manager | The camera manager

Returns
  A shared pointer to a new instance of the PipelineHandler subclass corresponding to the factory

## factories()

std::vector< PipelineHandlerFactory * > & libcamera::PipelineHandlerFactory::factories | ( |  | ) |

static

Retrieve the list of all pipeline handler factories.

The static factories map is defined inside the function to ensures it gets initialized on first use, without any dependency on link order.

Returns
  the list of pipeline handler factories

## name()

libcamera::PipelineHandlerFactory::name | ( |  | ) | const

inline

Retrieve the factory name.

Returns
  The factory name

## registerType()

void libcamera::PipelineHandlerFactory::registerType | ( | PipelineHandlerFactory * | factory | ) |

static

Add a pipeline handler class to the registry.

Parameters

  [in] | factory | Factory to use to construct the pipeline handler

The caller is responsible to guarantee the uniqueness of the pipeline handler name.

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

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