ipa: libipa: algorithm: Add an algorithm registration mechanism
In order to allow dynamic instantiation of algorithms based on tuning data files, add a mechanism to register algorithms with the IPA module. The implementation relies on an AlgorithmFactory class and a registration macro, similar to the pipeline handler registration mechanism. The main difference is that the algorithm registration and instantiation are implemented in the Module class instead of the AlgorithmFactory class, making the factory an internal implementation detail. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
This commit is contained in:
@@ -75,6 +75,30 @@ namespace ipa {
|
||||
* \brief The type of the IPA statistics and ISP results
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn Module::createAlgorithm()
|
||||
* \brief Create an instance of an Algorithm by name
|
||||
* \param[in] name The algorithm name
|
||||
*
|
||||
* This function is the entry point to algorithm instantiation for the IPA
|
||||
* module. It creates and returns an instance of an algorithm identified by its
|
||||
* \a name. If no such algorithm exists, the function returns nullptr.
|
||||
*
|
||||
* To make an algorithm available to the IPA module, it shall be registered with
|
||||
* the REGISTER_IPA_ALGORITHM() macro.
|
||||
*
|
||||
* \return A new instance of the Algorithm subclass corresponding to the \a name
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn Module::registerAlgorithm()
|
||||
* \brief Add an algorithm factory class to the list of available algorithms
|
||||
* \param[in] factory Factory to use to construct the algorithm
|
||||
*
|
||||
* This function registers an algorithm factory. It is meant to be called by the
|
||||
* AlgorithmFactory constructor only.
|
||||
*/
|
||||
|
||||
} /* namespace ipa */
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
Reference in New Issue
Block a user