libcamera: raspberrypi: Allow the tuning file to be set by an environment variable
The configuration (camera tuning) file used by the Raspberry Pi comes by default from the sensor name. However, we now allow this to be overridden by the LIBCAMERA_RPI_TUNING_FILE environment variable. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
committed by
Laurent Pinchart
parent
d6d4710d04
commit
eb9a539938
@@ -1233,8 +1233,18 @@ int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig)
|
||||
ipa_->setIspControls.connect(this, &RPiCameraData::setIspControls);
|
||||
ipa_->setDelayedControls.connect(this, &RPiCameraData::setDelayedControls);
|
||||
|
||||
IPASettings settings(ipa_->configurationFile(sensor_->model() + ".json"),
|
||||
sensor_->model());
|
||||
/*
|
||||
* The configuration (tuning file) is made from the sensor name unless
|
||||
* the environment variable overrides it.
|
||||
*/
|
||||
std::string configurationFile;
|
||||
char const *configFromEnv = utils::secure_getenv("LIBCAMERA_RPI_TUNING_FILE");
|
||||
if (!configFromEnv || *configFromEnv == '\0')
|
||||
configurationFile = ipa_->configurationFile(sensor_->model() + ".json");
|
||||
else
|
||||
configurationFile = std::string(configFromEnv);
|
||||
|
||||
IPASettings settings(configurationFile, sensor_->model());
|
||||
|
||||
return ipa_->init(settings, sensorConfig);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user