@@ -76,7 +76,7 @@ public:
std::unique_ptr<T> createIPA(uint32_t minVersion, uint32_t maxVersion)
{
IPAManager *ipaManager = manager_->_d()->ipaManager();
- return ipaManager->createIPA<T>(name_, minVersion, maxVersion);
+ return ipaManager->createIPA<T>(T::name(), minVersion, maxVersion);
}
template<typename T>
@@ -48,7 +48,7 @@ option('gstreamer',
option('ipas',
type : 'array',
- choices : ['ipu3', 'mali-c55', 'rkisp1', 'rpi/pisp', 'rpi/vc4', 'simple',
+ choices : ['ipu3', 'mali-c55', 'rkisp1', 'rpi/pisp', 'rpi/vc4', 'soft',
'vimc'],
description : 'Select which IPA modules to build')
@@ -30,7 +30,7 @@ supported_ipas = {
'rkisp1': 'rkisp1',
'rpi/pisp': 'rpi/pisp',
'rpi/vc4': 'rpi/vc4',
- 'simple': 'simple',
+ 'simple': 'soft',
'vimc': 'vimc'
}
similarity index 100%
rename from src/ipa/simple/algorithms/adjust.cpp
rename to src/ipa/soft/algorithms/adjust.cpp
similarity index 100%
rename from src/ipa/simple/algorithms/adjust.h
rename to src/ipa/soft/algorithms/adjust.h
similarity index 100%
rename from src/ipa/simple/algorithms/agc.cpp
rename to src/ipa/soft/algorithms/agc.cpp
similarity index 100%
rename from src/ipa/simple/algorithms/agc.h
rename to src/ipa/soft/algorithms/agc.h
similarity index 100%
rename from src/ipa/simple/algorithms/algorithm.h
rename to src/ipa/soft/algorithms/algorithm.h
similarity index 98%
rename from src/ipa/simple/algorithms/awb.cpp
rename to src/ipa/soft/algorithms/awb.cpp
@@ -15,7 +15,7 @@
#include <libcamera/control_ids.h>
#include "libipa/colours.h"
-#include "simple/ipa_context.h"
+#include "soft/ipa_context.h"
namespace libcamera {
similarity index 100%
rename from src/ipa/simple/algorithms/awb.h
rename to src/ipa/soft/algorithms/awb.h
similarity index 100%
rename from src/ipa/simple/algorithms/blc.cpp
rename to src/ipa/soft/algorithms/blc.cpp
similarity index 100%
rename from src/ipa/simple/algorithms/blc.h
rename to src/ipa/soft/algorithms/blc.h
similarity index 100%
rename from src/ipa/simple/algorithms/ccm.cpp
rename to src/ipa/soft/algorithms/ccm.cpp
similarity index 100%
rename from src/ipa/simple/algorithms/ccm.h
rename to src/ipa/soft/algorithms/ccm.h
similarity index 100%
rename from src/ipa/simple/algorithms/meson.build
rename to src/ipa/soft/algorithms/meson.build
similarity index 80%
rename from src/ipa/simple/data/meson.build
rename to src/ipa/soft/data/meson.build
@@ -6,5 +6,5 @@ conf_files = files([
# The install_dir must match the name from the IPAModuleInfo
install_data(conf_files,
- install_dir : ipa_data_dir / 'simple',
+ install_dir : ipa_data_dir / 'soft',
install_tag : 'runtime')
similarity index 100%
rename from src/ipa/simple/data/uncalibrated.yaml
rename to src/ipa/soft/data/uncalibrated.yaml
similarity index 100%
rename from src/ipa/simple/ipa_context.cpp
rename to src/ipa/soft/ipa_context.cpp
similarity index 100%
rename from src/ipa/simple/ipa_context.h
rename to src/ipa/soft/ipa_context.h
similarity index 100%
rename from src/ipa/simple/meson.build
rename to src/ipa/soft/meson.build
similarity index 100%
rename from src/ipa/simple/module.h
rename to src/ipa/soft/module.h
similarity index 99%
rename from src/ipa/simple/soft_simple.cpp
rename to src/ipa/soft/soft_simple.cpp
@@ -342,7 +342,7 @@ extern "C" {
const struct IPAModuleInfo ipaModuleInfo = {
IPA_MODULE_API_VERSION,
0,
- "simple",
+ "soft",
};
IPAInterface *ipaCreate()
@@ -844,8 +844,8 @@ void PipelineHandler::disconnect()
*
* Create an IPA module using \a ipaName as the matching identifier. This
* overload allows pipeline handlers to create an IPA module by specifying its
- * name instead of relying on the fact that the IPA module matches the pipeline
- * handler's one.
+ * name instead of relying on the fact that the IPA module matches the IPA
+ * proxy's type name.
*
* \return A newly created IPA proxy, or nullptr if no matching IPA module is
* found or if the IPA proxy fails to initialize
@@ -858,7 +858,7 @@ void PipelineHandler::disconnect()
* \param[in] minVersion Minimum acceptable version of IPA module
* \param[in] maxVersion Maximum acceptable version of IPA module
*
- * Create an IPA module using the pipeline handler name as the matching
+ * Create an IPA module using the IPA proxy's type name as the matching
* identifier. This overload allows pipeline handler to create an IPA module
* whose name matches the pipeline handler one.
*
@@ -40,6 +40,8 @@ class {{proxy_name}}Isolated;
class {{proxy_name}} : public IPAProxy, public {{interface_name}}, public Object
{
public:
+ static constexpr const char *name() { return "{{module_name}}"; };
+
using Threaded = {{proxy_name}}Threaded;
using Isolated = {{proxy_name}}Isolated;
Currently createIPA() / IPAManager::module() assume that there is a 1:1 relationship between pipeline handlers and IPAs and IPA matching is done based on matching the pipe's name to ipaModuleInfo.name[]. This coupling between pipeline name and which IPA to create is undesirable and makes it impossible to for example use the softISP as a fallback in other pipeline handlers then the simple pipeline handler. The actual API contract between the IPA and the pipeline handler is given by the IPA proxy type. Add a static IPAProxyXXX::name() to the generated IPAProxyXXX classes and use this in PipelineHandler::createIPA() instead of using PipelineHandler::name(). This requires changing the name, as well as the subdirectory of the softISP IPA from "simple" to "soft", which is the more sensible name anyway. Note: this means that softISP IPA config files will now be looked for under /usr/share/libcamera/ipa/soft instead of /usr/share/libcamera/ipa/simple! Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com> --- include/libcamera/internal/pipeline_handler.h | 2 +- meson_options.txt | 2 +- src/ipa/meson.build | 2 +- src/ipa/{simple => soft}/algorithms/adjust.cpp | 0 src/ipa/{simple => soft}/algorithms/adjust.h | 0 src/ipa/{simple => soft}/algorithms/agc.cpp | 0 src/ipa/{simple => soft}/algorithms/agc.h | 0 src/ipa/{simple => soft}/algorithms/algorithm.h | 0 src/ipa/{simple => soft}/algorithms/awb.cpp | 2 +- src/ipa/{simple => soft}/algorithms/awb.h | 0 src/ipa/{simple => soft}/algorithms/blc.cpp | 0 src/ipa/{simple => soft}/algorithms/blc.h | 0 src/ipa/{simple => soft}/algorithms/ccm.cpp | 0 src/ipa/{simple => soft}/algorithms/ccm.h | 0 src/ipa/{simple => soft}/algorithms/meson.build | 0 src/ipa/{simple => soft}/data/meson.build | 2 +- src/ipa/{simple => soft}/data/uncalibrated.yaml | 0 src/ipa/{simple => soft}/ipa_context.cpp | 0 src/ipa/{simple => soft}/ipa_context.h | 0 src/ipa/{simple => soft}/meson.build | 0 src/ipa/{simple => soft}/module.h | 0 src/ipa/{simple => soft}/soft_simple.cpp | 2 +- src/libcamera/pipeline_handler.cpp | 6 +++--- .../generators/libcamera_templates/module_ipa_proxy.h.tmpl | 2 ++ 24 files changed, 11 insertions(+), 9 deletions(-) rename src/ipa/{simple => soft}/algorithms/adjust.cpp (100%) rename src/ipa/{simple => soft}/algorithms/adjust.h (100%) rename src/ipa/{simple => soft}/algorithms/agc.cpp (100%) rename src/ipa/{simple => soft}/algorithms/agc.h (100%) rename src/ipa/{simple => soft}/algorithms/algorithm.h (100%) rename src/ipa/{simple => soft}/algorithms/awb.cpp (98%) rename src/ipa/{simple => soft}/algorithms/awb.h (100%) rename src/ipa/{simple => soft}/algorithms/blc.cpp (100%) rename src/ipa/{simple => soft}/algorithms/blc.h (100%) rename src/ipa/{simple => soft}/algorithms/ccm.cpp (100%) rename src/ipa/{simple => soft}/algorithms/ccm.h (100%) rename src/ipa/{simple => soft}/algorithms/meson.build (100%) rename src/ipa/{simple => soft}/data/meson.build (80%) rename src/ipa/{simple => soft}/data/uncalibrated.yaml (100%) rename src/ipa/{simple => soft}/ipa_context.cpp (100%) rename src/ipa/{simple => soft}/ipa_context.h (100%) rename src/ipa/{simple => soft}/meson.build (100%) rename src/ipa/{simple => soft}/module.h (100%) rename src/ipa/{simple => soft}/soft_simple.cpp (99%)