summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libcamera/ipa/core.mojom8
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp3
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp3
-rw-r--r--src/libcamera/pipeline/vimc/vimc.cpp10
-rw-r--r--test/ipa/ipa_interface_test.cpp2
5 files changed, 18 insertions, 8 deletions
diff --git a/include/libcamera/ipa/core.mojom b/include/libcamera/ipa/core.mojom
index 5236a672..5363f1c5 100644
--- a/include/libcamera/ipa/core.mojom
+++ b/include/libcamera/ipa/core.mojom
@@ -145,8 +145,16 @@ struct IPABuffer {
* This field may be an empty string if the IPA doesn't require a configuration
* file.
*/
+
+ /**
+ * \var IPASettings::sensorModel
+ * \brief The sensor model name
+ *
+ * Provides the sensor model name to the IPA.
+ */
struct IPASettings {
string configurationFile;
+ string sensorModel;
};
/**
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index c9e3c5ef..fc40dcb3 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -1144,7 +1144,8 @@ int IPU3CameraData::loadIPA()
ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction);
- ipa_->init(IPASettings{});
+ CameraSensor *sensor = cio2_.sensor();
+ ipa_->init(IPASettings{ "", sensor->model() });
return 0;
}
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 00fa62c9..2c8ae31a 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -1227,7 +1227,8 @@ int RPiCameraData::loadIPA()
ipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);
ipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);
- IPASettings settings(ipa_->configurationFile(sensor_->model() + ".json"));
+ IPASettings settings(ipa_->configurationFile(sensor_->model() + ".json"),
+ sensor_->model());
return ipa_->init(settings);
}
diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
index 57c65b02..8f5f4ba3 100644
--- a/src/libcamera/pipeline/vimc/vimc.cpp
+++ b/src/libcamera/pipeline/vimc/vimc.cpp
@@ -422,18 +422,18 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)
std::unique_ptr<VimcCameraData> data = std::make_unique<VimcCameraData>(this, media);
+ /* Locate and open the capture video node. */
+ if (data->init())
+ return false;
+
data->ipa_ = IPAManager::createIPA<ipa::vimc::IPAProxyVimc>(this, 0, 0);
if (data->ipa_ != nullptr) {
std::string conf = data->ipa_->configurationFile("vimc.conf");
- data->ipa_->init(IPASettings{ conf });
+ data->ipa_->init(IPASettings{ conf, data->sensor_->model() });
} else {
LOG(VIMC, Warning) << "no matching IPA found";
}
- /* Locate and open the capture video node. */
- if (data->init())
- return false;
-
/* Create and register the camera. */
std::set<Stream *> streams{ &data->stream_ };
std::shared_ptr<Camera> camera =
diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
index 4b88806f..d6ca6f51 100644
--- a/test/ipa/ipa_interface_test.cpp
+++ b/test/ipa/ipa_interface_test.cpp
@@ -104,7 +104,7 @@ protected:
/* Test initialization of IPA module. */
std::string conf = ipa_->configurationFile("vimc.conf");
- int ret = ipa_->init(IPASettings{ conf });
+ int ret = ipa_->init(IPASettings{ conf, "vimc" });
if (ret < 0) {
cerr << "IPA interface init() failed" << endl;
return TestFail;
a of the libcamera codebase, the names can be located within the source code, for example: `src/libcamera/camera_manager.cpp <https://git.libcamera.org/libcamera/libcamera.git/tree/src/libcamera/camera_manager.cpp#n35>`__ .. code:: cpp LOG_DEFINE_CATEGORY(Camera) There are two available macros used to assign a category name to a part of the libcamera codebase: LOG_DEFINE_CATEGORY This macro is required, in order to use the ``LOGC`` macro for a particular category. It can only be used once for each category. If you want to create log messages within multiple compilation units for the same category utilize the ``LOG_DECLARE_CATEGORY`` macro, in every file except the definition file. LOG_DECLARE_CATEGORY Used for sharing an already defined category between multiple separate compilation units. Both macros have to be used within the libcamera namespace of the C++ source code. IPA configuration ~~~~~~~~~~~~~~~~~ IPA modules use configuration files to store parameters. The format and contents of the configuration files is specific to the IPA module. They usually contain tuning parameters for the algorithms, in JSON format. The ``LIBCAMERA_IPA_CONFIG_PATH`` variable can be used to specify custom storage locations to search for those configuration files. `Examples <https://git.libcamera.org/libcamera/libcamera.git/tree/src/ipa/rpi/vc4/data>`__ IPA module ~~~~~~~~~~ In order to locate the correct IPA module for your hardware, libcamera gathers existing IPA modules from multiple locations. The default locations for this operation are the installed system path (for example on Debian: ``/usr/local/x86_64-pc-linux-gnu/libcamera``) and the build directory. With the ``LIBCAMERA_IPA_MODULE_PATH``, you can specify a non-default location to search for IPA modules.