From ee918b370a08b362de75ee590cfc46fe8e38a0f0 Mon Sep 17 00:00:00 2001 From: Stefan Klug Date: Thu, 23 Jan 2025 13:09:14 +0100 Subject: ipa: rkisp1: agc: Initialize enum controls with a list of values The controls ExposureTimeMode and AnalogueGainMode are shown in camshark as normal int entries instead of enum popups. The reason is that ControlInfos for these controls are constructed using min/max instead of a list of valid ControlValues. Camshark (and cam) uses the values() vector to deduce if the control is an enum or not. It might be debatable if this is the correct check, but all other ControlInfos for enum controls in libcamera are initialized using a list. Modify the construction of the ControlInfos to use the Span based constructor to fix that issue. Signed-off-by: Stefan Klug Reviewed-by: Laurent Pinchart Reviewed-by: Paul Elder --- src/ipa/rkisp1/algorithms/agc.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/ipa/rkisp1') diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index 1680669c..e7c6de75 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -149,13 +149,13 @@ int Agc::init(IPAContext &context, const YamlObject &tuningData) return ret; context.ctrlMap[&controls::ExposureTimeMode] = - ControlInfo(static_cast(controls::ExposureTimeModeAuto), - static_cast(controls::ExposureTimeModeManual), - static_cast(controls::ExposureTimeModeAuto)); + ControlInfo({ { ControlValue(controls::ExposureTimeModeAuto), + ControlValue(controls::ExposureTimeModeManual) } }, + controls::ExposureTimeModeAuto); context.ctrlMap[&controls::AnalogueGainMode] = - ControlInfo(static_cast(controls::AnalogueGainModeAuto), - static_cast(controls::AnalogueGainModeManual), - static_cast(controls::AnalogueGainModeAuto)); + ControlInfo({ { ControlValue(controls::AnalogueGainModeAuto), + ControlValue(controls::AnalogueGainModeManual) } }, + controls::AnalogueGainModeAuto); /* \todo Move this to the Camera class */ context.ctrlMap[&controls::AeEnable] = ControlInfo(false, true, true); context.ctrlMap.merge(controls()); -- cgit v1.2.1