[libcamera-devel,v2,1/4] ipa: libipa: algorithm: Add queueRequest() to the Algorithm class
diff mbox series

Message ID 20220720154221.50937-2-fsylvestre@baylibre.com
State Accepted
Headers show
Series
  • Add Demosaicing and Color Processing control for rkisp1
Related show

Commit Message

Florian Sylvestre July 20, 2022, 3:42 p.m. UTC
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>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/ipa/libipa/algorithm.cpp | 16 ++++++++++++++++
 src/ipa/libipa/algorithm.h   |  8 ++++++++
 2 files changed, 24 insertions(+)

Comments

Nicolas Dufresne via libcamera-devel July 21, 2022, 7:42 a.m. UTC | #1
Hi Florian,

On Wed, Jul 20, 2022 at 05:42:18PM +0200, Florian Sylvestre via libcamera-devel wrote:
> 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>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/ipa/libipa/algorithm.cpp | 16 ++++++++++++++++
>  src/ipa/libipa/algorithm.h   |  8 ++++++++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp
> index 8549fe3f..38200e57 100644
> --- a/src/ipa/libipa/algorithm.cpp
> +++ b/src/ipa/libipa/algorithm.cpp
> @@ -81,6 +81,22 @@ 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 number to apply the control values
> + * \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 2a8871d8..ccc659a6 100644
> --- a/src/ipa/libipa/algorithm.h
> +++ b/src/ipa/libipa/algorithm.h
> @@ -9,6 +9,8 @@
>  #include <memory>
>  #include <string>
>  
> +#include <libcamera/controls.h>
> +
>  namespace libcamera {
>  
>  class YamlObject;
> @@ -40,6 +42,12 @@ public:
>  	{
>  	}
>  
> +	virtual void queueRequest([[maybe_unused]] typename Module::Context &context,
> +				  [[maybe_unused]] const uint32_t frame,
> +				  [[maybe_unused]] const ControlList &controls)
> +	{
> +	}
> +
>  	virtual void process([[maybe_unused]] typename Module::Context &context,
>  			     [[maybe_unused]] typename Module::FrameContext *frameContext,
>  			     [[maybe_unused]] const typename Module::Stats *stats)
> -- 
> 2.34.1
>
Kieran Bingham July 21, 2022, 12:52 p.m. UTC | #2
Hi Florian,

Quoting Florian Sylvestre via libcamera-devel (2022-07-20 16:42:18)
> 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>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I think this is going the right direction for what I had in mind too,
and you may have seen I've picked this into my development branch [0]

https://lists.libcamera.org/pipermail/libcamera-devel/2022-July/032471.html

I've tried to get the changes from v1 to v2 in that branch as well, but
I originally picked from v1, so I might have to take a closer look
later.

I don't really mind which series goes in first, I can rebase my work
accordingly.


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  src/ipa/libipa/algorithm.cpp | 16 ++++++++++++++++
>  src/ipa/libipa/algorithm.h   |  8 ++++++++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp
> index 8549fe3f..38200e57 100644
> --- a/src/ipa/libipa/algorithm.cpp
> +++ b/src/ipa/libipa/algorithm.cpp
> @@ -81,6 +81,22 @@ 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 number to apply the control values
> + * \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 2a8871d8..ccc659a6 100644
> --- a/src/ipa/libipa/algorithm.h
> +++ b/src/ipa/libipa/algorithm.h
> @@ -9,6 +9,8 @@
>  #include <memory>
>  #include <string>
>  
> +#include <libcamera/controls.h>
> +
>  namespace libcamera {
>  
>  class YamlObject;
> @@ -40,6 +42,12 @@ public:
>         {
>         }
>  
> +       virtual void queueRequest([[maybe_unused]] typename Module::Context &context,
> +                                 [[maybe_unused]] const uint32_t frame,
> +                                 [[maybe_unused]] const ControlList &controls)
> +       {
> +       }
> +
>         virtual void process([[maybe_unused]] typename Module::Context &context,
>                              [[maybe_unused]] typename Module::FrameContext *frameContext,
>                              [[maybe_unused]] const typename Module::Stats *stats)
> -- 
> 2.34.1
>

Patch
diff mbox series

diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp
index 8549fe3f..38200e57 100644
--- a/src/ipa/libipa/algorithm.cpp
+++ b/src/ipa/libipa/algorithm.cpp
@@ -81,6 +81,22 @@  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 number to apply the control values
+ * \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 2a8871d8..ccc659a6 100644
--- a/src/ipa/libipa/algorithm.h
+++ b/src/ipa/libipa/algorithm.h
@@ -9,6 +9,8 @@ 
 #include <memory>
 #include <string>
 
+#include <libcamera/controls.h>
+
 namespace libcamera {
 
 class YamlObject;
@@ -40,6 +42,12 @@  public:
 	{
 	}
 
+	virtual void queueRequest([[maybe_unused]] typename Module::Context &context,
+				  [[maybe_unused]] const uint32_t frame,
+				  [[maybe_unused]] const ControlList &controls)
+	{
+	}
+
 	virtual void process([[maybe_unused]] typename Module::Context &context,
 			     [[maybe_unused]] typename Module::FrameContext *frameContext,
 			     [[maybe_unused]] const typename Module::Stats *stats)