summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libcamera/include/ipa_module.h5
-rw-r--r--src/libcamera/ipa_module.cpp20
2 files changed, 25 insertions, 0 deletions
diff --git a/src/libcamera/include/ipa_module.h b/src/libcamera/include/ipa_module.h
index 7ac5cad5..fec42371 100644
--- a/src/libcamera/include/ipa_module.h
+++ b/src/libcamera/include/ipa_module.h
@@ -13,6 +13,8 @@
#include <libcamera/ipa/ipa_interface.h>
#include <libcamera/ipa/ipa_module_info.h>
+#include "pipeline_handler.h"
+
namespace libcamera {
class IPAModule
@@ -29,6 +31,9 @@ public:
std::unique_ptr<IPAInterface> createInstance();
+ bool match(PipelineHandler *pipe,
+ uint32_t minVersion, uint32_t maxVersion) const;
+
private:
struct IPAModuleInfo info_;
diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp
index 5490f9b6..2663b9ef 100644
--- a/src/libcamera/ipa_module.cpp
+++ b/src/libcamera/ipa_module.cpp
@@ -18,6 +18,7 @@
#include <unistd.h>
#include "log.h"
+#include "pipeline_handler.h"
/**
* \file ipa_module.h
@@ -391,4 +392,23 @@ std::unique_ptr<IPAInterface> IPAModule::createInstance()
return std::unique_ptr<IPAInterface>(ipaCreate_());
}
+/**
+ * \brief Verify if the IPA module maches a given pipeline handler
+ * \param[in] pipe Pipeline handler to match with
+ * \param[in] minVersion Minimum acceptable version of IPA module
+ * \param[in] maxVersion Maximum acceptable version of IPA module
+ *
+ * This method checks if this IPA module matches the \a pipe pipeline handler,
+ * and the input version range.
+ *
+ * \return True if the pipeline handler matches the IPA module, or false otherwise
+ */
+bool IPAModule::match(PipelineHandler *pipe,
+ uint32_t minVersion, uint32_t maxVersion) const
+{
+ return info_.pipelineVersion >= minVersion &&
+ info_.pipelineVersion <= maxVersion &&
+ !strcmp(info_.pipelineName, pipe->name());
+}
+
} /* namespace libcamera */
91' href='#n191'>191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308