ipa: Add sensor model string to IPASettings
Pass the sensor model string to the IPA init() method through the IPASettings structure. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
500c9a1f98
commit
ff9f60ce3f
5 changed files with 21 additions and 11 deletions
|
@ -145,8 +145,16 @@ struct IPABuffer {
|
||||||
* This field may be an empty string if the IPA doesn't require a configuration
|
* This field may be an empty string if the IPA doesn't require a configuration
|
||||||
* file.
|
* file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \var IPASettings::sensorModel
|
||||||
|
* \brief The sensor model name
|
||||||
|
*
|
||||||
|
* Provides the sensor model name to the IPA.
|
||||||
|
*/
|
||||||
struct IPASettings {
|
struct IPASettings {
|
||||||
string configurationFile;
|
string configurationFile;
|
||||||
|
string sensorModel;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1144,7 +1144,8 @@ int IPU3CameraData::loadIPA()
|
||||||
|
|
||||||
ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction);
|
ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction);
|
||||||
|
|
||||||
ipa_->init(IPASettings{});
|
CameraSensor *sensor = cio2_.sensor();
|
||||||
|
ipa_->init(IPASettings{ "", sensor->model() });
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1227,7 +1227,8 @@ int RPiCameraData::loadIPA()
|
||||||
ipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);
|
ipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);
|
||||||
ipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);
|
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);
|
return ipa_->init(settings);
|
||||||
}
|
}
|
||||||
|
|
|
@ -422,18 +422,18 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)
|
||||||
|
|
||||||
std::unique_ptr<VimcCameraData> data = std::make_unique<VimcCameraData>(this, media);
|
std::unique_ptr<VimcCameraData> data = std::make_unique<VimcCameraData>(this, media);
|
||||||
|
|
||||||
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 });
|
|
||||||
} else {
|
|
||||||
LOG(VIMC, Warning) << "no matching IPA found";
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Locate and open the capture video node. */
|
/* Locate and open the capture video node. */
|
||||||
if (data->init())
|
if (data->init())
|
||||||
return false;
|
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->sensor_->model() });
|
||||||
|
} else {
|
||||||
|
LOG(VIMC, Warning) << "no matching IPA found";
|
||||||
|
}
|
||||||
|
|
||||||
/* Create and register the camera. */
|
/* Create and register the camera. */
|
||||||
std::set<Stream *> streams{ &data->stream_ };
|
std::set<Stream *> streams{ &data->stream_ };
|
||||||
std::shared_ptr<Camera> camera =
|
std::shared_ptr<Camera> camera =
|
||||||
|
|
|
@ -104,7 +104,7 @@ protected:
|
||||||
|
|
||||||
/* Test initialization of IPA module. */
|
/* Test initialization of IPA module. */
|
||||||
std::string conf = ipa_->configurationFile("vimc.conf");
|
std::string conf = ipa_->configurationFile("vimc.conf");
|
||||||
int ret = ipa_->init(IPASettings{ conf });
|
int ret = ipa_->init(IPASettings{ conf, "vimc" });
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
cerr << "IPA interface init() failed" << endl;
|
cerr << "IPA interface init() failed" << endl;
|
||||||
return TestFail;
|
return TestFail;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue