@@ -22,11 +22,16 @@ public:
const struct IPAModuleInfo &info() const;
+ bool acquired();
+ bool acquire();
+ void release();
+
private:
struct IPAModuleInfo info_;
std::string libPath_;
bool valid_;
+ bool acquired_;
int loadIPAModuleInfo();
};
@@ -212,7 +212,7 @@ int elfLoadSymbol(void *dst, size_t size, void *map, size_t soSize,
* IPAModule instance to verify the validity of the IPAModule.
*/
IPAModule::IPAModule(const std::string &libPath)
- : libPath_(libPath), valid_(false)
+ : libPath_(libPath), valid_(false), acquired_(false)
{
if (loadIPAModuleInfo() < 0)
return;
@@ -289,4 +289,23 @@ const struct IPAModuleInfo &IPAModule::info() const
return info_;
}
+bool IPAModule::acquired()
+{
+ return acquired_;
+}
+
+bool IPAModule::acquire()
+{
+ if (acquired_)
+ return false;
+
+ acquired_ = true;
+ return true;
+}
+
+void IPAModule::release()
+{
+ acquired_ = false;
+}
+
} /* namespace libcamera */
The IPAManager will be designed like an enumerator, and IPA modules cannot be used by multiple pipelines at once. Add an aquired attribute to IPAModule, and corresponding getter and setters. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- src/libcamera/include/ipa_module.h | 5 +++++ src/libcamera/ipa_module.cpp | 21 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-)