@@ -25,6 +25,7 @@ ipa_mojom_core = custom_target(core_mojom_file.split('.')[0] + '_mojom_module',
ipa_mojom_files = [
'raspberrypi.mojom',
+ 'vimc.mojom',
]
ipa_mojoms = []
similarity index 87%
rename from include/libcamera/ipa/ipa_vimc.h
rename to include/libcamera/ipa/vimc.h
@@ -8,6 +8,8 @@
#ifndef __LIBCAMERA_IPA_VIMC_H__
#define __LIBCAMERA_IPA_VIMC_H__
+#include <libcamera/controls.h>
+
namespace libcamera {
#define VIMC_IPA_FIFO_PATH "/tmp/libcamera_ipa_vimc_fifo"
@@ -19,6 +21,8 @@ enum IPAOperationCode {
IPAOperationStop,
};
+static ControlInfoMap VimcControls;
+
} /* namespace libcamera */
#endif /* __LIBCAMERA_IPA_VIMC_H__ */
new file mode 100644
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+import "include/libcamera/ipa/core.mojom";
+
+interface IPAVimcInterface {
+ init(IPASettings settings) => (int32 ret);
+ start() => (int32 ret);
+ stop();
+};
+
+interface IPAVimcCallbackInterface {
+};
@@ -3,7 +3,7 @@
ipa_name = 'ipa_vimc'
mod = shared_module(ipa_name,
- 'vimc.cpp',
+ ['vimc.cpp', libcamera_generated_headers],
name_prefix : '',
include_directories : [ipa_includes, libipa_includes],
dependencies : libcamera_dep,
@@ -5,7 +5,8 @@
* ipa_vimc.cpp - Vimc Image Processing Algorithm module
*/
-#include <libcamera/ipa/ipa_vimc.h>
+#include <libcamera/ipa/vimc.h>
+#include <libcamera/ipa/vimc_generated.h>
#include <fcntl.h>
#include <string.h>
@@ -26,7 +27,7 @@ namespace libcamera {
LOG_DEFINE_CATEGORY(IPAVimc)
-class IPAVimc : public IPAInterface
+class IPAVimc : public IPAVimcInterface
{
public:
IPAVimc();
@@ -37,15 +38,6 @@ public:
int start() override;
void stop() override;
- void configure([[maybe_unused]] const CameraSensorInfo &sensorInfo,
- [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig,
- [[maybe_unused]] const std::map<unsigned int, const ControlInfoMap &> &entityControls,
- [[maybe_unused]] const IPAOperationData &ipaConfig,
- [[maybe_unused]] IPAOperationData *result) override {}
- void mapBuffers([[maybe_unused]] const std::vector<IPABuffer> &buffers) override {}
- void unmapBuffers([[maybe_unused]] const std::vector<unsigned int> &ids) override {}
- void processEvent([[maybe_unused]] const IPAOperationData &event) override {}
-
private:
void initTrace();
void trace(enum IPAOperationCode operation);
@@ -141,9 +133,9 @@ const struct IPAModuleInfo ipaModuleInfo = {
"vimc",
};
-struct ipa_context *ipaCreate()
+IPAInterface *ipaCreate()
{
- return new IPAInterfaceWrapper(std::make_unique<IPAVimc>());
+ return new IPAVimc();
}
}
@@ -34,6 +34,10 @@
#include "libcamera/internal/v4l2_subdevice.h"
#include "libcamera/internal/v4l2_videodevice.h"
+#include <libcamera/ipa/vimc.h>
+#include <libcamera/ipa/vimc_generated.h>
+#include <libcamera/ipa/ipa_proxy_vimc.h>
+
namespace libcamera {
LOG_DEFINE_CATEGORY(VIMC)
@@ -67,6 +71,8 @@ public:
V4L2VideoDevice *video_;
V4L2VideoDevice *raw_;
Stream stream_;
+
+ std::unique_ptr<IPAProxyVimc> ipa_;
};
class VimcCameraConfiguration : public CameraConfiguration
@@ -423,7 +429,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)
std::unique_ptr<VimcCameraData> data = std::make_unique<VimcCameraData>(this, media);
- data->ipa_ = IPAManager::createIPA(this, 0, 0);
+ data->ipa_ = IPAManager::createIPA<IPAProxyVimc>(this, 0, 0);
if (data->ipa_ != nullptr) {
std::string conf = data->ipa_->configurationFile("vimc.conf");
data->ipa_->init(IPASettings{ conf });
Add support to vimc pipeline handler and IPA for the new IPC mechanism. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- New in v2 --- include/libcamera/ipa/meson.build | 1 + include/libcamera/ipa/{ipa_vimc.h => vimc.h} | 4 ++++ include/libcamera/ipa/vimc.mojom | 12 ++++++++++++ src/ipa/vimc/meson.build | 2 +- src/ipa/vimc/vimc.cpp | 18 +++++------------- src/libcamera/pipeline/vimc/vimc.cpp | 8 +++++++- 6 files changed, 30 insertions(+), 15 deletions(-) rename include/libcamera/ipa/{ipa_vimc.h => vimc.h} (87%) create mode 100644 include/libcamera/ipa/vimc.mojom