[libcamera-devel,19/38] libcamera: IPAProxy: Add isolate parameter to create()

Message ID 20200922133537.258098-20-paul.elder@ideasonboard.com
State Superseded
Headers show
Series
  • IPA isolation implementation
Related show

Commit Message

Paul Elder Sept. 22, 2020, 1:35 p.m. UTC
Since IPAProxy implementations now always encapsulate IPA modules, add a
parameter to create() to signal if the proxy should isolate the IPA or not.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

---
Changes in v2:
- document isolate argument
---
 include/libcamera/internal/ipa_proxy.h | 22 +++++++++++-----------
 src/libcamera/ipa_proxy.cpp            |  4 +++-
 2 files changed, 14 insertions(+), 12 deletions(-)

Patch

diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h
index aec8f04f..1903150e 100644
--- a/include/libcamera/internal/ipa_proxy.h
+++ b/include/libcamera/internal/ipa_proxy.h
@@ -42,7 +42,7 @@  public:
 	IPAProxyFactory(const char *name);
 	virtual ~IPAProxyFactory() {}
 
-	virtual std::unique_ptr<IPAProxy> create(IPAModule *ipam) = 0;
+	virtual std::unique_ptr<IPAProxy> create(IPAModule *ipam, bool isolate) = 0;
 
 	const std::string &name() const { return name_; }
 
@@ -53,16 +53,16 @@  private:
 	std::string name_;
 };
 
-#define REGISTER_IPA_PROXY(proxy)			\
-class proxy##Factory final : public IPAProxyFactory	\
-{							\
-public:							\
-	proxy##Factory() : IPAProxyFactory(#proxy) {}	\
-	std::unique_ptr<IPAProxy> create(IPAModule *ipam)	\
-	{						\
-		return std::make_unique<proxy>(ipam);	\
-	}						\
-};							\
+#define REGISTER_IPA_PROXY(proxy)					\
+class proxy##Factory final : public IPAProxyFactory			\
+{									\
+public:									\
+	proxy##Factory() : IPAProxyFactory(#proxy) {}			\
+	std::unique_ptr<IPAProxy> create(IPAModule *ipam, bool isolate)	\
+	{								\
+		return std::make_unique<proxy>(ipam, isolate);		\
+	}								\
+};									\
 static proxy##Factory global_##proxy##Factory;
 
 } /* namespace libcamera */
diff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp
index 23be24ad..ee5e6f3e 100644
--- a/src/libcamera/ipa_proxy.cpp
+++ b/src/libcamera/ipa_proxy.cpp
@@ -250,10 +250,12 @@  IPAProxyFactory::IPAProxyFactory(const char *name)
  * \fn IPAProxyFactory::create()
  * \brief Create an instance of the IPAProxy corresponding to the factory
  * \param[in] ipam The IPA module
+ * \param[in] isolate Flag to isolate the IPA module
  *
  * This virtual function is implemented by the REGISTER_IPA_PROXY() macro.
  * It creates a IPAProxy instance that isolates an IPA interface designated
- * by the IPA module \a ipam.
+ * by the IPA module \a ipam. If \a isolate is true, then the IPA module will
+ * be isolated.
  *
  * \return A pointer to a newly constructed instance of the IPAProxy subclass
  * corresponding to the factory