diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-12 01:52:00 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-19 08:20:34 +0300 |
commit | a5c81fc9457a295070243c4230a65805645e046a (patch) | |
tree | 2c0a603f377adde5db7a66f253b9487bd12cf530 /src | |
parent | 8847715ccdeb44d09dd8a49399257da235ffcc23 (diff) |
libcamera: ipa_manager: Split common code out of createIPA()
The createIPA() template function starts with code that doesn't depend
on the template parameters. Split it to a non-template function to avoid
code duplication in the binary.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/ipa_manager.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp index b4606c61..73a86886 100644 --- a/src/libcamera/ipa_manager.cpp +++ b/src/libcamera/ipa_manager.cpp @@ -246,6 +246,23 @@ unsigned int IPAManager::addDir(const char *libDir, unsigned int maxDepth) } /** + * \brief Retrieve an IPA module that matches a given pipeline handler + * \param[in] pipe The pipeline handler + * \param[in] minVersion Minimum acceptable version of IPA module + * \param[in] maxVersion Maximum acceptable version of IPA module + */ +IPAModule *IPAManager::module(PipelineHandler *pipe, uint32_t minVersion, + uint32_t maxVersion) +{ + for (IPAModule *module : modules_) { + if (module->match(pipe, minVersion, maxVersion)) + return module; + } + + return nullptr; +} + +/** * \fn IPAManager::createIPA() * \brief Create an IPA proxy that matches a given pipeline handler * \param[in] pipe The pipeline handler that wants a matching IPA proxy |