[libcamera-devel] [PATCH v2 1/2] libcamera: control: initialise control info to ControlTypeNone by default
paul.elder at ideasonboard.com
paul.elder at ideasonboard.com
Wed Aug 31 23:09:09 CEST 2022
On Wed, Aug 31, 2022 at 12:51:48PM +0100, Kieran Bingham via libcamera-devel wrote:
> Quoting Christian Rauch via libcamera-devel (2022-08-30 21:21:23)
> > The default ControlInfo constructor allows to partially initialised the
> > min/max/def values. Uninitialised values are assigned to 0 by default. This
> > implicit initialisation makes it impossible to distinguish between and
> > uninitialised and an explicitly 0-initialised ControlValue.
> >
> > Default construct the ControlValue in the ControlInfo default contructor to
> > explicitly represent uninitialised values by the ControlTypeNone type.
>
> This sounds ... a lot better !
>
> Testing with this series applied (including the patch 2/2, which should
> probably be squashed to one patch to maintain bisection) has the
> following failures for me:
>
> 27/70 libcamera:serialization / ipa_data_serializer_test FAIL 0.02s (exit status 255 or signal 127 SIGinvalid)
> >>> MALLOC_PERTURB_=174 /home/kbingham/iob/libcamera/libcamera/build/gcc/test/serialization/ipa_data_serializer_test
> ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀ ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
> stderr:
> [148:04:16.561414604] [830675] INFO IPAManager ipa_manager.cpp:141 libcamera is not installed. Adding '/home/kbingham/iob/libcamera/libcamera/build/gcc/src/ipa' to the IPA search path
> [148:04:16.562718193] [830675] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3856-6478a395
> [148:04:16.567590564] [830679] WARN CameraSensorProperties camera_sensor_properties.cpp:174 No static properties available for 'Sensor B'
> [148:04:16.567599841] [830679] WARN CameraSensorProperties camera_sensor_properties.cpp:176 Please consider updating the camera sensor properties database
> [148:04:16.567605382] [830679] WARN CameraSensor camera_sensor.cpp:411 'Sensor B': Failed to retrieve the camera location
> [148:04:16.568583439] [830679] INFO IPAProxy ipa_proxy.cpp:130 libcamera is not installed. Loading IPA configuration from '/home/kbingham/iob/libcamera/libcamera/src/ipa/vimc/data'
> [148:04:16.569025699] [830675] ERROR Serializer control_serializer.cpp:509 Bad data, entry offset mismatch (entry 1)
> lhs:
> - 1: [false..true]
> - 7: [0..999999]
> - 8: [1.000000..32.000000]
> - 9: [-1.000000..1.000000]
> - 15: [0.000000..32.000000]
> rhs:
> Deserialized std::vector<libcamera::ControlInfoMap> doesn't match original
>
> So I think we have to identify what impact this has on control
> serialisation. I expect we haven't tried to serialize ControlTypeNone
> before.
This is probably related to bug 137 [1].
Maybe it's time to fix it :p
Paul
[1] https://bugs.libcamera.org/show_bug.cgi?id=137
>
> But I think this is a good path to take currently.
>
> --
> Kieran
>
>
> >
> > Signed-off-by: Christian Rauch <Rauch.Christian at gmx.de>
> > ---
> > include/libcamera/controls.h | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
> > index ebc168fc..38d0a3e8 100644
> > --- a/include/libcamera/controls.h
> > +++ b/include/libcamera/controls.h
> > @@ -268,9 +268,9 @@ private:
> > class ControlInfo
> > {
> > public:
> > - explicit ControlInfo(const ControlValue &min = 0,
> > - const ControlValue &max = 0,
> > - const ControlValue &def = 0);
> > + explicit ControlInfo(const ControlValue &min = {},
> > + const ControlValue &max = {},
> > + const ControlValue &def = {});
> > explicit ControlInfo(Span<const ControlValue> values,
> > const ControlValue &def = {});
> > explicit ControlInfo(std::set<bool> values, bool def);
> > --
> > 2.34.1
> >
More information about the libcamera-devel
mailing list