summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ipa/libipa/ipa_interface_wrapper.cpp8
-rw-r--r--src/ipa/libipa/ipa_interface_wrapper.h3
-rw-r--r--src/ipa/rkisp1/rkisp1.cpp2
-rw-r--r--src/ipa/vimc/vimc.cpp4
-rw-r--r--src/libcamera/include/ipa_context_wrapper.h2
-rw-r--r--src/libcamera/ipa_context_wrapper.cpp9
-rw-r--r--src/libcamera/ipa_interface.cpp34
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1.cpp2
-rw-r--r--src/libcamera/pipeline/vimc/vimc.cpp2
-rw-r--r--src/libcamera/proxy/ipa_proxy_linux.cpp2
-rw-r--r--src/libcamera/proxy/ipa_proxy_thread.cpp6
11 files changed, 58 insertions, 16 deletions
diff --git a/src/ipa/libipa/ipa_interface_wrapper.cpp b/src/ipa/libipa/ipa_interface_wrapper.cpp
index f50f93a0..9596cb20 100644
--- a/src/ipa/libipa/ipa_interface_wrapper.cpp
+++ b/src/ipa/libipa/ipa_interface_wrapper.cpp
@@ -79,11 +79,15 @@ void *IPAInterfaceWrapper::get_interface(struct ipa_context *_ctx)
return ctx->ipa_.get();
}
-void IPAInterfaceWrapper::init(struct ipa_context *_ctx)
+void IPAInterfaceWrapper::init(struct ipa_context *_ctx,
+ const struct ipa_settings *settings)
{
IPAInterfaceWrapper *ctx = static_cast<IPAInterfaceWrapper *>(_ctx);
- ctx->ipa_->init();
+ IPASettings ipaSettings{
+ .configurationFile = settings->configuration_file
+ };
+ ctx->ipa_->init(ipaSettings);
}
int IPAInterfaceWrapper::start(struct ipa_context *_ctx)
diff --git a/src/ipa/libipa/ipa_interface_wrapper.h b/src/ipa/libipa/ipa_interface_wrapper.h
index e4bc6dd4..78ccf0f5 100644
--- a/src/ipa/libipa/ipa_interface_wrapper.h
+++ b/src/ipa/libipa/ipa_interface_wrapper.h
@@ -23,7 +23,8 @@ public:
private:
static void destroy(struct ipa_context *ctx);
static void *get_interface(struct ipa_context *ctx);
- static void init(struct ipa_context *ctx);
+ static void init(struct ipa_context *ctx,
+ const struct ipa_settings *settings);
static int start(struct ipa_context *ctx);
static void stop(struct ipa_context *ctx);
static void register_callbacks(struct ipa_context *ctx,
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 7f0ffb0a..9a347e52 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -32,7 +32,7 @@ LOG_DEFINE_CATEGORY(IPARkISP1)
class IPARkISP1 : public IPAInterface
{
public:
- int init() override { return 0; }
+ int init(const IPASettings &settings) override { return 0; }
int start() override { return 0; }
void stop() override {}
diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp
index cfdbd6f9..e6bda8ec 100644
--- a/src/ipa/vimc/vimc.cpp
+++ b/src/ipa/vimc/vimc.cpp
@@ -31,7 +31,7 @@ public:
IPAVimc();
~IPAVimc();
- int init() override;
+ int init(const IPASettings &settings) override;
int start() override;
void stop() override;
@@ -61,7 +61,7 @@ IPAVimc::~IPAVimc()
::close(fd_);
}
-int IPAVimc::init()
+int IPAVimc::init(const IPASettings &settings)
{
trace(IPAOperationInit);
diff --git a/src/libcamera/include/ipa_context_wrapper.h b/src/libcamera/include/ipa_context_wrapper.h
index 0a48bfe7..64395b4a 100644
--- a/src/libcamera/include/ipa_context_wrapper.h
+++ b/src/libcamera/include/ipa_context_wrapper.h
@@ -19,7 +19,7 @@ public:
IPAContextWrapper(struct ipa_context *context);
~IPAContextWrapper();
- int init() override;
+ int init(const IPASettings &settings) override;
int start() override;
void stop() override;
void configure(const std::map<unsigned int, IPAStream> &streamConfig,
diff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp
index ab6ce396..5bd5d916 100644
--- a/src/libcamera/ipa_context_wrapper.cpp
+++ b/src/libcamera/ipa_context_wrapper.cpp
@@ -69,15 +69,18 @@ IPAContextWrapper::~IPAContextWrapper()
ctx_->ops->destroy(ctx_);
}
-int IPAContextWrapper::init()
+int IPAContextWrapper::init(const IPASettings &settings)
{
if (intf_)
- return intf_->init();
+ return intf_->init(settings);
if (!ctx_)
return 0;
- ctx_->ops->init(ctx_);
+ struct ipa_settings c_settings;
+ c_settings.configuration_file = settings.configurationFile.c_str();
+
+ ctx_->ops->init(ctx_, &c_settings);
return 0;
}
diff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp
index 890d4340..616f20fb 100644
--- a/src/libcamera/ipa_interface.cpp
+++ b/src/libcamera/ipa_interface.cpp
@@ -93,6 +93,16 @@
*/
/**
+ * \struct ipa_settings
+ * \brief IPA initialization settings for the IPA context operations
+ * \sa IPASettings
+ *
+ * \var ipa_settings::configuration_file
+ * \brief The name of the IPA configuration file (may be null or point to an
+ * empty string)
+ */
+
+/**
* \struct ipa_stream
* \brief Stream information for the IPA context operations
*
@@ -231,6 +241,7 @@
* \var ipa_context_ops::init
* \brief Initialise the IPA context
* \param[in] ctx The IPA context
+ * \param[in] settings The IPA initialization settings
*
* \sa libcamera::IPAInterface::init()
*/
@@ -311,6 +322,24 @@
namespace libcamera {
/**
+ * \struct IPASettings
+ * \brief IPA interface initialization settings
+ *
+ * The IPASettings structure stores data passed to the IPAInterface::init()
+ * function. The data contains settings that don't depend on a particular camera
+ * or pipeline configuration and are valid for the whole life time of the IPA
+ * interface.
+ */
+
+/**
+ * \var IPASettings::configurationFile
+ * \brief The name of the IPA configuration file
+ *
+ * This field may be an empty string if the IPA doesn't require a configuration
+ * file.
+ */
+
+/**
* \struct IPAStream
* \brief Stream configuration for the IPA interface
*
@@ -424,6 +453,11 @@ namespace libcamera {
/**
* \fn IPAInterface::init()
* \brief Initialise the IPAInterface
+ * \param[in] settings The IPA initialization settings
+ *
+ * This function initializes the IPA interface. It shall be called before any
+ * other function of the IPAInterface. The \a settings carry initialization
+ * parameters that are valid for the whole life time of the IPA interface.
*/
/**
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index f4226436..fde445b9 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -401,7 +401,7 @@ int RkISP1CameraData::loadIPA()
ipa_->queueFrameAction.connect(this,
&RkISP1CameraData::queueFrameAction);
- ipa_->init();
+ ipa_->init(IPASettings{});
return 0;
}
diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
index 77de4c38..99f5261b 100644
--- a/src/libcamera/pipeline/vimc/vimc.cpp
+++ b/src/libcamera/pipeline/vimc/vimc.cpp
@@ -385,7 +385,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)
if (data->ipa_ == nullptr)
LOG(VIMC, Warning) << "no matching IPA found";
else
- data->ipa_->init();
+ data->ipa_->init(IPASettings{});
/* Locate and open the capture video node. */
if (data->init(media))
diff --git a/src/libcamera/proxy/ipa_proxy_linux.cpp b/src/libcamera/proxy/ipa_proxy_linux.cpp
index 89f5cb54..cd8ac824 100644
--- a/src/libcamera/proxy/ipa_proxy_linux.cpp
+++ b/src/libcamera/proxy/ipa_proxy_linux.cpp
@@ -26,7 +26,7 @@ public:
IPAProxyLinux(IPAModule *ipam);
~IPAProxyLinux();
- int init() override { return 0; }
+ int init(const IPASettings &settings) override { return 0; }
int start() override { return 0; }
void stop() override {}
void configure(const std::map<unsigned int, IPAStream> &streamConfig,
diff --git a/src/libcamera/proxy/ipa_proxy_thread.cpp b/src/libcamera/proxy/ipa_proxy_thread.cpp
index 1ebb9b6a..be82fde3 100644
--- a/src/libcamera/proxy/ipa_proxy_thread.cpp
+++ b/src/libcamera/proxy/ipa_proxy_thread.cpp
@@ -25,7 +25,7 @@ class IPAProxyThread : public IPAProxy, public Object
public:
IPAProxyThread(IPAModule *ipam);
- int init() override;
+ int init(const IPASettings &settings) override;
int start() override;
void stop() override;
@@ -97,9 +97,9 @@ IPAProxyThread::IPAProxyThread(IPAModule *ipam)
valid_ = true;
}
-int IPAProxyThread::init()
+int IPAProxyThread::init(const IPASettings &settings)
{
- int ret = ipa_->init();
+ int ret = ipa_->init(settings);
if (ret)
return ret;