[libcamera-devel] [PATCH 1/4] ipa: libipa: algorithm: Add queueRequest() to the Algorithm class
Florian Sylvestre
fsylvestre at baylibre.com
Mon Jul 4 17:23:15 CEST 2022
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 at baylibre.com>
---
src/ipa/ipu3/module.h | 2 +-
src/ipa/libipa/algorithm.cpp | 13 +++++++++++++
src/ipa/libipa/algorithm.h | 6 ++++++
src/ipa/libipa/module.cpp | 5 +++++
src/ipa/libipa/module.h | 3 ++-
src/ipa/rkisp1/module.h | 2 +-
6 files changed, 28 insertions(+), 3 deletions(-)
diff --git a/src/ipa/ipu3/module.h b/src/ipa/ipu3/module.h
index d94fc459..5c2179e0 100644
--- a/src/ipa/ipu3/module.h
+++ b/src/ipa/ipu3/module.h
@@ -20,7 +20,7 @@ namespace libcamera {
namespace ipa::ipu3 {
using Module = ipa::Module<IPAContext, IPAFrameContext, IPAConfigInfo,
- ipu3_uapi_params, ipu3_uapi_stats_3a>;
+ ipu3_uapi_params, ipu3_uapi_stats_3a, ControlList>;
} /* namespace ipa::ipu3 */
diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp
index 8549fe3f..1fb811ef 100644
--- a/src/ipa/libipa/algorithm.cpp
+++ b/src/ipa/libipa/algorithm.cpp
@@ -81,6 +81,19 @@ 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 aplly the control values
+ * \param[in] controls The list of user controls
+ *
+ * This function provides controls values coming from the application to the
+ * algorithm. A frame number is provided to indicate the concerned frame.
+ * Each algorithm is responsible for retrieving the controls associated to
+ * them.
+ */
+
/**
* \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..aa846625 100644
--- a/src/ipa/libipa/algorithm.h
+++ b/src/ipa/libipa/algorithm.h
@@ -40,6 +40,12 @@ public:
{
}
+ virtual void queueRequest([[maybe_unused]] typename Module::Context &context,
+ [[maybe_unused]] const uint32_t frame,
+ [[maybe_unused]] const typename Module::ControlList &controls)
+ {
+ }
+
virtual void process([[maybe_unused]] typename Module::Context &context,
[[maybe_unused]] typename Module::FrameContext *frameContext,
[[maybe_unused]] const typename Module::Stats *stats)
diff --git a/src/ipa/libipa/module.cpp b/src/ipa/libipa/module.cpp
index 77352104..e87a52fc 100644
--- a/src/ipa/libipa/module.cpp
+++ b/src/ipa/libipa/module.cpp
@@ -77,6 +77,11 @@ namespace ipa {
* \brief The type of the IPA statistics and ISP results
*/
+/**
+ * \typedef Module::ControlList
+ * \brief The type of the ISP runtime controls list
+ */
+
/**
* \fn Module::algorithms()
* \brief Retrieve the list of instantiated algorithms
diff --git a/src/ipa/libipa/module.h b/src/ipa/libipa/module.h
index 4149a353..81d3bf7f 100644
--- a/src/ipa/libipa/module.h
+++ b/src/ipa/libipa/module.h
@@ -26,7 +26,7 @@ LOG_DECLARE_CATEGORY(IPAModuleAlgo)
namespace ipa {
template<typename _Context, typename _FrameContext, typename _Config,
- typename _Params, typename _Stats>
+ typename _Params, typename _Stats, typename _ControlList>
class Module : public Loggable
{
public:
@@ -35,6 +35,7 @@ public:
using Config = _Config;
using Params = _Params;
using Stats = _Stats;
+ using ControlList = _ControlList;
virtual ~Module() {}
diff --git a/src/ipa/rkisp1/module.h b/src/ipa/rkisp1/module.h
index 89f83208..08381a08 100644
--- a/src/ipa/rkisp1/module.h
+++ b/src/ipa/rkisp1/module.h
@@ -20,7 +20,7 @@ namespace libcamera {
namespace ipa::rkisp1 {
using Module = ipa::Module<IPAContext, IPAFrameContext, IPACameraSensorInfo,
- rkisp1_params_cfg, rkisp1_stat_buffer>;
+ rkisp1_params_cfg, rkisp1_stat_buffer, ControlList>;
} /* namespace ipa::rkisp1 */
--
2.34.1
More information about the libcamera-devel
mailing list