@@ -20,6 +20,7 @@
#include <libcamera/base/file.h>
#include <libcamera/base/log.h>
+#include <libcamera/base/span.h>
#include <libcamera/base/utils.h>
#include <libcamera/control_ids.h>
@@ -280,10 +281,11 @@ void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo,
uint64_t frameSize = lineLength * frameHeights[i];
frameDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);
}
+ std::array<int64_t, 2> defFrameDurations = { frameDurations[2], frameDurations[2] };
controls[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],
frameDurations[1],
- frameDurations[2]);
+ Span<const int64_t, 2>{ defFrameDurations });
controls.merge(context_.ctrlMap);
*ipaControls = ControlInfoMap(std::move(controls), controls::controls);
@@ -5,6 +5,7 @@
* Mali-C55 ISP image processing algorithms
*/
+#include <array>
#include <map>
#include <string.h>
#include <vector>
@@ -14,6 +15,7 @@
#include <libcamera/base/file.h>
#include <libcamera/base/log.h>
+#include <libcamera/base/span.h>
#include <libcamera/control_ids.h>
#include <libcamera/ipa/ipa_interface.h>
@@ -234,9 +236,10 @@ void IPAMaliC55::updateControls(const IPACameraSensorInfo &sensorInfo,
frameDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);
}
+ std::array<int64_t, 2> defFrameDurations = { frameDurations[2], frameDurations[2] };
ctrlMap[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],
frameDurations[1],
- frameDurations[2]);
+ Span<const int64_t, 2>{ defFrameDurations });
/*
* Compute exposure time limits from the V4L2_CID_EXPOSURE control
@@ -91,7 +91,10 @@ int Awb::init(IPAContext &context, const YamlObject &tuningData)
kMaxColourTemperature,
kDefaultColourTemperature);
cmap[&controls::AwbEnable] = ControlInfo(false, true);
- cmap[&controls::ColourGains] = ControlInfo(0.0f, 3.996f, 1.0f);
+
+ std::array<float, 2> defColourGains = { 1.0f, 1.0f };
+ cmap[&controls::ColourGains] = ControlInfo(0.0f, 3.996f,
+ Span<const float, 2>{ defColourGains });
if (!tuningData.contains("algorithm"))
LOG(RkISP1Awb, Info) << "No AWB algorithm specified."
@@ -436,10 +436,12 @@ void IPARkISP1::updateControls(const IPACameraSensorInfo &sensorInfo,
uint64_t frameSize = lineLength * frameHeights[i];
frameDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);
}
+ std::array<int64_t, 2> defFrameDurations = { frameDurations[2], frameDurations[2] };
/* \todo Move this (and other agc-related controls) to agc */
context_.ctrlMap[&controls::FrameDurationLimits] =
- ControlInfo(frameDurations[0], frameDurations[1], frameDurations[2]);
+ ControlInfo(frameDurations[0], frameDurations[1],
+ ControlValue(Span<const int64_t, 2>{ defFrameDurations }));
ctrlMap.insert(context_.ctrlMap.begin(), context_.ctrlMap.end());
*ipaControls = ControlInfoMap(std::move(ctrlMap), controls::controls);
@@ -7,6 +7,7 @@
#include "ipa_base.h"
+#include <array>
#include <cmath>
#include <libcamera/base/log.h>
@@ -243,10 +244,14 @@ int32_t IpaBase::configure(const IPACameraSensorInfo &sensorInfo, const ConfigPa
* based on the current sensor mode.
*/
ControlInfoMap::Map ctrlMap = ipaControls;
+ std::array<int64_t, 2> defFrameDurations = {
+ static_cast<int64_t>(defaultMinFrameDuration.get<std::micro>()),
+ static_cast<int64_t>(defaultMinFrameDuration.get<std::micro>())
+ };
ctrlMap[&controls::FrameDurationLimits] =
ControlInfo(static_cast<int64_t>(mode_.minFrameDuration.get<std::micro>()),
static_cast<int64_t>(mode_.maxFrameDuration.get<std::micro>()),
- static_cast<int64_t>(defaultMinFrameDuration.get<std::micro>()));
+ Span<const int64_t, 2>{ defFrameDurations });
ctrlMap[&controls::AnalogueGain] =
ControlInfo(static_cast<float>(mode_.minAnalogueGain),
The ControlInfos of non-scalar controls that are reported in controls() must have non-scalar default values for controls that have a defined size. This is because applications should be able to directly set the default value from a ControlInfo to the control. Currently this is relevant to the following controls: - ColourGains - ColourCorrectionMatrix - FrameDurationLimits Fix the scalarness of these controls where relevant. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> --- Changes in v4: - improve commit message No change in v3 No change in v2 --- src/ipa/ipu3/ipu3.cpp | 4 +++- src/ipa/mali-c55/mali-c55.cpp | 5 ++++- src/ipa/rkisp1/algorithms/awb.cpp | 5 ++++- src/ipa/rkisp1/rkisp1.cpp | 4 +++- src/ipa/rpi/common/ipa_base.cpp | 7 ++++++- 5 files changed, 20 insertions(+), 5 deletions(-)