pipeline: raspberrypi: Update naming convention for tuning files
Append "_mono" to the sensor name when generating the tuning filename for monochrome sensor variants. So the new naming convention is as follows: <sensor_name>.json - Standard colour sensor variant <sensor_name>_mono.json - Monochrome sensor variant Rename the existing imx296.json file to imx296_mono.json as this tuning file is based on the monochrome variant of the IMX296. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-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
ec63095716
commit
820607b195
3 changed files with 16 additions and 4 deletions
|
@ -4,7 +4,7 @@ conf_files = files([
|
|||
'imx219.json',
|
||||
'imx219_noir.json',
|
||||
'imx290.json',
|
||||
'imx296.json',
|
||||
'imx296_mono.json',
|
||||
'imx378.json',
|
||||
'imx477.json',
|
||||
'imx477_noir.json',
|
||||
|
|
|
@ -67,6 +67,14 @@ SensorFormats populateSensorFormats(std::unique_ptr<CameraSensor> &sensor)
|
|||
return formats;
|
||||
}
|
||||
|
||||
bool isMonoSensor(std::unique_ptr<CameraSensor> &sensor)
|
||||
{
|
||||
unsigned int mbusCode = sensor->mbusCodes()[0];
|
||||
const BayerFormat &bayer = BayerFormat::fromMbusCode(mbusCode);
|
||||
|
||||
return bayer.order == BayerFormat::Order::MONO;
|
||||
}
|
||||
|
||||
PixelFormat mbusCodeToPixelFormat(unsigned int mbus_code,
|
||||
BayerFormat::Packing packingReq)
|
||||
{
|
||||
|
@ -1541,10 +1549,14 @@ int RPiCameraData::loadIPA(ipa::RPi::IPAInitResult *result)
|
|||
*/
|
||||
std::string configurationFile;
|
||||
char const *configFromEnv = utils::secure_getenv("LIBCAMERA_RPI_TUNING_FILE");
|
||||
if (!configFromEnv || *configFromEnv == '\0')
|
||||
configurationFile = ipa_->configurationFile(sensor_->model() + ".json");
|
||||
else
|
||||
if (!configFromEnv || *configFromEnv == '\0') {
|
||||
std::string model = sensor_->model();
|
||||
if (isMonoSensor(sensor_))
|
||||
model += "_mono";
|
||||
configurationFile = ipa_->configurationFile(model + ".json");
|
||||
} else {
|
||||
configurationFile = std::string(configFromEnv);
|
||||
}
|
||||
|
||||
IPASettings settings(configurationFile, sensor_->model());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue