diff options
-rw-r--r-- | src/ipa/raspberrypi/data/imx296_mono.json (renamed from src/ipa/raspberrypi/data/imx296.json) | 0 | ||||
-rw-r--r-- | src/ipa/raspberrypi/data/meson.build | 2 | ||||
-rw-r--r-- | src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 18 |
3 files changed, 16 insertions, 4 deletions
diff --git a/src/ipa/raspberrypi/data/imx296.json b/src/ipa/raspberrypi/data/imx296_mono.json index 490c0fda..490c0fda 100644 --- a/src/ipa/raspberrypi/data/imx296.json +++ b/src/ipa/raspberrypi/data/imx296_mono.json diff --git a/src/ipa/raspberrypi/data/meson.build b/src/ipa/raspberrypi/data/meson.build index 211811cf..465a7a17 100644 --- a/src/ipa/raspberrypi/data/meson.build +++ b/src/ipa/raspberrypi/data/meson.build @@ -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', diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index bcb5bb8a..d366a8be 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -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()); |