libcamera: control_serializer: Accept empty ControlList

Accept empty `ControlList`s without an info map. Serialization
supports `ControlList`s without an associated `ControlInfoMap`
object. However, for deserialization, a "v4l2" control list
without an info map resulted in a fatal error.

After 30114cadd8 ("ipa: rpi: Defer initialising AF LensPosition ControlInfo and value")
the `lensControls` member of `ipa::RPi::ConfigResult` is left empty
and without an info map in every case, not just when a lens is not present.
This causes the above assertion to trigger every single time.

Also fix the indefinite article of "a ControlInfoMap" in the
error message.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Isaac Scott <isaac.scott@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze
2025-07-25 09:26:54 +02:00
parent 16da4892ed
commit e0fcbea494
+4 -2
View File
@@ -601,8 +601,10 @@ ControlList ControlSerializer::deserialize<ControlList>(ByteStreamBuffer &buffer
case IPA_CONTROL_ID_MAP_V4L2:
default:
LOG(Serializer, Fatal)
<< "A list of V4L2 controls requires an ControlInfoMap";
if (hdr->entries > 0)
LOG(Serializer, Fatal)
<< "A list of V4L2 controls requires a ControlInfoMap";
return {};
}
}