@@ -297,7 +297,7 @@ int AgcMeanLuminance::parseExposureModes(const YamlObject &tuningData)
* possible before touching gain.
*/
if (availableExposureModes.empty()) {
- int32_t exposureModeId = controls::ExposureNormal;
+ auto exposureModeId = controls::ExposureNormal;
std::vector<std::pair<utils::Duration, double>> stages = { };
std::shared_ptr<ExposureModeHelper> helper =
@@ -1584,7 +1584,9 @@ void IpaBase::reportMetadata(unsigned int ipaContext)
const AfStatus *afStatus = rpiMetadata.getLocked<AfStatus>("af.status");
if (afStatus) {
- int32_t s, p;
+ controls::AfStateEnum s;
+ controls::AfPauseStateEnum p;
+
switch (afStatus->state) {
case AfState::Scanning:
s = controls::AfStateScanning;
@@ -571,7 +571,7 @@ int CameraSensorLegacy::initProperties()
const auto &orientation = controls.find(V4L2_CID_CAMERA_ORIENTATION);
if (orientation != controls.end()) {
int32_t v4l2Orientation = orientation->second.def().get<int32_t>();
- int32_t propertyValue;
+ properties::LocationEnum propertyValue;
switch (v4l2Orientation) {
default:
@@ -624,7 +624,8 @@ int CameraSensorLegacy::initProperties()
/* Color filter array pattern, register only for RAW sensors. */
if (bayerFormat_) {
- int32_t cfa;
+ auto cfa = properties::draft::MONO;
+
switch (bayerFormat_->order) {
case BayerFormat::BGGR:
cfa = properties::draft::BGGR;
@@ -576,7 +576,7 @@ int CameraSensorRaw::initProperties()
const auto &orientation = controls.find(V4L2_CID_CAMERA_ORIENTATION);
if (orientation != controls.end()) {
int32_t v4l2Orientation = orientation->second.def().get<int32_t>();
- int32_t propertyValue;
+ properties::LocationEnum propertyValue;
switch (v4l2Orientation) {
default:
@@ -628,7 +628,7 @@ int CameraSensorRaw::initProperties()
properties_.set(properties::PixelArrayActiveAreas, { activeArea_ });
/* Color filter array pattern. */
- uint32_t cfa;
+ auto cfa = properties::draft::MONO;
switch (cfaPattern_) {
case BayerFormat::BGGR:
@@ -644,7 +644,6 @@ int CameraSensorRaw::initProperties()
cfa = properties::draft::RGGB;
break;
case BayerFormat::MONO:
- default:
cfa = properties::draft::MONO;
break;
}
The enumerated controls/properties use `int32_t` as their backing type. In multiple cases, when parsing such an enum value from a source, an integer type is used. Replace the integer type with the proper enum type where it is trivially doable. This change also brings `CameraSensorLegacy::initProperties()` in line with `CameraSensorRaw::initProperties()`, by defaulting the color filter arrangement to `MONO`. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/ipa/libipa/agc_mean_luminance.cpp | 2 +- src/ipa/rpi/common/ipa_base.cpp | 4 +++- src/libcamera/sensor/camera_sensor_legacy.cpp | 5 +++-- src/libcamera/sensor/camera_sensor_raw.cpp | 5 ++--- 4 files changed, 9 insertions(+), 7 deletions(-)