libcamera
v0.0.0
Supporting cameras in Linux since 2019
|
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... | |
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.
libcamera::PipelineHandlerFactory::PipelineHandlerFactory | ( | const char * | name | ) |
Construct a pipeline handler factory.
[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.
std::shared_ptr< PipelineHandler > libcamera::PipelineHandlerFactory::create | ( | CameraManager * | manager | ) |
Create an instance of the PipelineHandler corresponding to the factory.
[in] | manager | The camera manager |
|
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.
|
inline |
Retrieve the factory name.
|
static |
Add a pipeline handler class to the registry.
[in] | factory | Factory to use to construct the pipeline handler |
The caller is responsible to guarantee the uniqueness of the pipeline handler name.