@@ -52,6 +52,9 @@ int Dpf::init([[maybe_unused]] IPAContext &context,
if (ret)
return ret;
+ /* Register available controls. */
+ registerControls(context);
+
return 0;
}
@@ -112,6 +115,24 @@ int Dpf::parseConfig(const YamlObject &tuningData)
return 0;
}
+void Dpf::registerControls(IPAContext &context)
+{
+ /*
+ * Populate the control map with the available noise reduction modes.
+ * This allows applications to query and select from the modes defined
+ * in the tuning data.
+ */
+ std::vector<ControlValue> modes{ controls::draft::NoiseReductionModeOff };
+ for (const auto &mode : noiseReductionModes_) {
+ modes.emplace_back(mode.modeValue);
+ }
+ /*
+ * Set the default mode to the active mode.
+ */
+ context.ctrlMap[&controls::draft::NoiseReductionMode] =
+ ControlInfo(modes, activeMode_->modeValue);
+}
+
int Dpf::parseSingleConfig(const YamlObject &tuningData,
rkisp1_cif_isp_dpf_config &config,
rkisp1_cif_isp_dpf_strength_config &strengthConfig)
@@ -37,6 +37,7 @@ private:
};
int parseConfig(const YamlObject &tuningData);
+ void registerControls(IPAContext &context);
int parseSingleConfig(const YamlObject &tuningData,
rkisp1_cif_isp_dpf_config &config,
rkisp1_cif_isp_dpf_strength_config &strengthConfig);
@@ -120,7 +120,6 @@ const IPAHwSettings ipaHwSettingsV12{
/* List of controls handled by the RkISP1 IPA */
const ControlInfoMap::Map rkisp1Controls{
{ &controls::DebugMetadataEnable, ControlInfo(false, true, false) },
- { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) },
};
} /* namespace */