[libcamera-devel,RFC,10/12] ipa: libipa: algorithm: Add queueRequest() to the Algorithm class
diff mbox series

Message ID 20220721121310.1286862-11-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Align IPU3 and RKISP1 interfaces
Related show

Commit Message

Kieran Bingham July 21, 2022, 12:13 p.m. UTC
From: Florian Sylvestre <fsylvestre@baylibre.com>

Add queueRequest() function to the Algorithm class. The queueRequest() function
provides controls values coming from the application to each algorithm.
Each algorithm is responsible for retrieving the controls associated to them.

Signed-off-by: Florian Sylvestre <fsylvestre@baylibre.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

---
v2: (Kieran)

 - Adjust function ordering
 - Add FrameContext to queueRequest
 - Removed Module::ControlList and using libcamera::ControlList
   directly

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/ipa/libipa/algorithm.cpp | 17 +++++++++++++++++
 src/ipa/libipa/algorithm.h   |  9 +++++++++
 2 files changed, 26 insertions(+)

Patch
diff mbox series

diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp
index 65e9e8a56fc4..020b0b57b632 100644
--- a/src/ipa/libipa/algorithm.cpp
+++ b/src/ipa/libipa/algorithm.cpp
@@ -83,6 +83,23 @@  namespace ipa {
  * includes setting fields and flags that enable those processing blocks.
  */
 
+/**
+ * \fn Algorithm::queueRequest()
+ * \brief Provide control values to the algorithm
+ * \param[in] context The shared IPA context
+ * \param[in] frame The frame context sequence number
+ * \param[in] frameContext The current frame's context
+ * \param[in] controls The list of user controls
+ *
+ * This function is called for each request queued to the camera. It provides
+ * the controls stored in the request to the algorithm. The \a frame number
+ * is the Request sequence number and identifies the desired corresponding
+ * frame to target for the controls to take effect.
+ *
+ * Algorithms shall read the applicable controls and store their value for later
+ * use during frame processing.
+ */
+
 /**
  * \fn Algorithm::process()
  * \brief Process ISP statistics, and run algorithm operations
diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h
index 1d2544a767eb..5ccc640955c4 100644
--- a/src/ipa/libipa/algorithm.h
+++ b/src/ipa/libipa/algorithm.h
@@ -11,6 +11,7 @@ 
 
 namespace libcamera {
 
+class ControlList;
 class YamlObject;
 
 namespace ipa {
@@ -35,6 +36,14 @@  public:
 		return 0;
 	}
 
+
+	virtual void queueRequest([[maybe_unused]] typename Module::Context &context,
+				  [[maybe_unused]] const uint32_t frame,
+				  [[maybe_unused]] typename Module::FrameContext &frameContext,
+				  [[maybe_unused]] const ControlList &controls)
+	{
+	}
+
 	virtual void prepare([[maybe_unused]] typename Module::Context &context,
 			     [[maybe_unused]] unsigned int frame,
 			     [[maybe_unused]] typename Module::FrameContext &frameContext,