libcamera: pipeline_handler: Implement factories through class templates

The REGISTER_PIPELINE_HANDLER() macro defines a class type that inherits
from the PipelineHandlerFactory class, and implements a constructor and
a createInstance() function. Replace the code generation through macro
with the C++ equivalent, a class template, as done in libipa with the
Algorithm and CameraSensorHelper factories.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Laurent Pinchart 2022-10-03 22:55:11 +03:00
parent ba3a1adc13
commit 0bc9286eb9
4 changed files with 71 additions and 50 deletions

View file

@ -52,9 +52,9 @@ protected:
ipaManager_ = make_unique<IPAManager>();
/* Create a pipeline handler for vimc. */
const std::vector<PipelineHandlerFactory *> &factories =
PipelineHandlerFactory::factories();
for (const PipelineHandlerFactory *factory : factories) {
const std::vector<PipelineHandlerFactoryBase *> &factories =
PipelineHandlerFactoryBase::factories();
for (const PipelineHandlerFactoryBase *factory : factories) {
if (factory->name() == "PipelineHandlerVimc") {
pipe_ = factory->create(nullptr);
break;