ipa: vimc: Add IPAOperationCode to init() parameter list
For the purpose of testing serializing/deserializing enums in function parameters, add IPAOperationCode to the parameter list of init(). Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
deaf13de9b
commit
23fd404690
4 changed files with 7 additions and 5 deletions
|
@ -18,7 +18,7 @@ enum IPAOperationCode {
|
|||
};
|
||||
|
||||
interface IPAVimcInterface {
|
||||
init(libcamera.IPASettings settings) => (int32 ret);
|
||||
init(libcamera.IPASettings settings, IPAOperationCode code) => (int32 ret);
|
||||
|
||||
configure(libcamera.IPACameraSensorInfo sensorInfo,
|
||||
map<uint32, libcamera.IPAStream> streamConfig,
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
IPAVimc();
|
||||
~IPAVimc();
|
||||
|
||||
int init(const IPASettings &settings) override;
|
||||
int init(const IPASettings &settings, const ipa::vimc::IPAOperationCode code) override;
|
||||
|
||||
int start() override;
|
||||
void stop() override;
|
||||
|
@ -66,7 +66,7 @@ IPAVimc::~IPAVimc()
|
|||
::close(fd_);
|
||||
}
|
||||
|
||||
int IPAVimc::init(const IPASettings &settings)
|
||||
int IPAVimc::init(const IPASettings &settings, const ipa::vimc::IPAOperationCode code)
|
||||
{
|
||||
trace(ipa::vimc::IPAOperationInit);
|
||||
|
||||
|
@ -74,6 +74,8 @@ int IPAVimc::init(const IPASettings &settings)
|
|||
<< "initializing vimc IPA with configuration file "
|
||||
<< settings.configurationFile;
|
||||
|
||||
LOG(IPAVimc, Debug) << "Got opcode " << code;
|
||||
|
||||
File conf(settings.configurationFile);
|
||||
if (!conf.open(File::OpenModeFlag::ReadOnly)) {
|
||||
LOG(IPAVimc, Error) << "Failed to open configuration file";
|
||||
|
|
|
@ -471,7 +471,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)
|
|||
data->ipa_->paramsBufferReady.connect(data.get(), &VimcCameraData::paramsBufferReady);
|
||||
|
||||
std::string conf = data->ipa_->configurationFile("vimc.conf");
|
||||
data->ipa_->init(IPASettings{ conf, data->sensor_->model() });
|
||||
data->ipa_->init(IPASettings{ conf, data->sensor_->model() }, ipa::vimc::IPAOperationInit);
|
||||
|
||||
/* Create and register the camera. */
|
||||
std::set<Stream *> streams{ &data->stream_ };
|
||||
|
|
|
@ -106,7 +106,7 @@ protected:
|
|||
|
||||
/* Test initialization of IPA module. */
|
||||
std::string conf = ipa_->configurationFile("vimc.conf");
|
||||
int ret = ipa_->init(IPASettings{ conf, "vimc" });
|
||||
int ret = ipa_->init(IPASettings{ conf, "vimc" }, ipa::vimc::IPAOperationInit);
|
||||
if (ret < 0) {
|
||||
cerr << "IPA interface init() failed" << endl;
|
||||
return TestFail;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue