diff --git a/src/ipa/libipa/module.cpp b/src/ipa/libipa/module.cpp index 64ca9141..a95dca69 100644 --- a/src/ipa/libipa/module.cpp +++ b/src/ipa/libipa/module.cpp @@ -94,6 +94,14 @@ namespace ipa { * algorithms. The configuration data is expected to be correct, any error * causes the function to fail and return immediately. * + * Algorithms can optionally be disabled via the tuning file of the camera + * module as shown here, with AGC being used as an example: + * + * - Agc: + * enabled: false + * + * If this is the case, the algorithm will not be instantiated. + * * \return 0 on success, or a negative error code on failure */ diff --git a/src/ipa/libipa/module.h b/src/ipa/libipa/module.h index 0fb51916..c27af771 100644 --- a/src/ipa/libipa/module.h +++ b/src/ipa/libipa/module.h @@ -74,6 +74,18 @@ private: int createAlgorithm(Context &context, const YamlObject &data) { const auto &[name, algoData] = *data.asDict().begin(); + + /* + * Optionally, algorithms can be disabled via the tuning file + * by including enabled: false as a parameter within the + * algorithm tuning data. This is not an error, so we return 0. + */ + if (!algoData["enabled"].get(true)) { + LOG(IPAModuleAlgo, Info) + << "Algorithm '" << name << "' disabled via tuning file"; + return 0; + } + std::unique_ptr> algo = createAlgorithm(name); if (!algo) { LOG(IPAModuleAlgo, Error)