test: ipa: ipa_interface: Use IPAManager::createIPA()

The goal of ipa_interface is to unit test the IPA interface. It
currently creates the IPA proxy through the higher level PipelineHandler
class. Use the IPAManager::createIPA() function instead to keep the
focus on the components that were meant to be tested.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
This commit is contained in:
Laurent Pinchart
2025-10-20 19:03:17 +03:00
parent db998e618a
commit b97c6f2883
+11 -1
View File
@@ -22,6 +22,8 @@
#include "libcamera/internal/camera_manager.h"
#include "libcamera/internal/device_enumerator.h"
#include "libcamera/internal/global_configuration.h"
#include "libcamera/internal/ipa_manager.h"
#include "libcamera/internal/ipa_module.h"
#include "libcamera/internal/pipeline_handler.h"
@@ -43,6 +45,8 @@ public:
{
delete notifier_;
ipa_.reset();
ipaManager_.reset();
config_.reset();
cameraManager_.reset();
}
@@ -90,6 +94,10 @@ protected:
notifier_ = new EventNotifier(fd_, EventNotifier::Read, this);
notifier_->activated.connect(this, &IPAInterfaceTest::readTrace);
/* Create the IPA manager. */
config_ = std::make_unique<GlobalConfiguration>();
ipaManager_ = std::make_unique<IPAManager>(*config_);
return TestPass;
}
@@ -98,7 +106,7 @@ protected:
EventDispatcher *dispatcher = thread()->eventDispatcher();
Timer timer;
ipa_ = pipe_->createIPA<ipa::vimc::IPAProxyVimc>(0, 0);
ipa_ = ipaManager_->createIPA<ipa::vimc::IPAProxyVimc>(pipe_.get(), 0, 0);
if (!ipa_) {
cerr << "Failed to create VIMC IPA interface" << endl;
return TestFail;
@@ -173,6 +181,8 @@ private:
std::shared_ptr<PipelineHandler> pipe_;
std::unique_ptr<ipa::vimc::IPAProxyVimc> ipa_;
std::unique_ptr<CameraManager> cameraManager_;
std::unique_ptr<GlobalConfiguration> config_;
std::unique_ptr<IPAManager> ipaManager_;
enum ipa::vimc::IPAOperationCode trace_;
EventNotifier *notifier_;
int fd_;