diff options
-rw-r--r-- | include/libcamera/internal/ipa_manager.h | 13 | ||||
-rw-r--r-- | src/libcamera/ipa_manager.cpp | 17 |
2 files changed, 21 insertions, 9 deletions
diff --git a/include/libcamera/internal/ipa_manager.h b/include/libcamera/internal/ipa_manager.h index 42201839..0687842e 100644 --- a/include/libcamera/internal/ipa_manager.h +++ b/include/libcamera/internal/ipa_manager.h @@ -34,15 +34,7 @@ public: uint32_t minVersion, uint32_t maxVersion) { - IPAModule *m = nullptr; - - for (IPAModule *module : self_->modules_) { - if (module->match(pipe, minVersion, maxVersion)) { - m = module; - break; - } - } - + IPAModule *m = self_->module(pipe, minVersion, maxVersion); if (!m) return nullptr; @@ -62,6 +54,9 @@ private: std::vector<std::string> &files); unsigned int addDir(const char *libDir, unsigned int maxDepth = 0); + IPAModule *module(PipelineHandler *pipe, uint32_t minVersion, + uint32_t maxVersion); + bool isSignatureValid(IPAModule *ipa) const; std::vector<IPAModule *> modules_; 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 |