libcamera/src
Kieran Bingham 96ed45b971 libcamera: v4l2_device: Workaround faulty control menus
Some UVC cameras have been identified that can provide V4L2 menu
controls without any menu items.

This leads to a segfault where we try to construct a
ControlInfo(Span<>,default) with an empty span.

Convert the v4l2ControlInfo and v4l2MenuControlInfo helper functions to
return std::optional<ControlInfo> to be able to account in the caller if
the control is valid, and only add acceptable controls to the supported
control list.

Menu controls without a list of menu items are no longer added as a
valid control and a warning is logged.

This also fixes a potential crash that would have occured in the
unlikely event that a ctrl.minimum was set to less than 0.

Bug: https://bugs.libcamera.org/show_bug.cgi?id=167
Reported-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-11-28 17:15:35 +00:00
..
android libcamera: stream: Turn StreamRole into scoped enumeration 2022-11-25 10:52:06 +02:00
apps cam: capture_script: Support parsing array controls 2022-11-25 12:07:17 +01:00
gstreamer libcamera: stream: Turn StreamRole into scoped enumeration 2022-11-25 10:52:06 +02:00
ipa ipa: rkisp1: agc: Support raw capture 2022-11-25 10:52:06 +02:00
libcamera libcamera: v4l2_device: Workaround faulty control menus 2022-11-28 17:15:35 +00:00
py py: Support controls that are ControlTypeNone 2022-09-30 23:12:05 +03:00
v4l2 v4l2: v4l2_camera: Apply clang thread safety annotation 2022-11-11 16:25:47 +05:30
meson.build Move test applications to src/apps/ 2022-10-20 13:36:25 +03:00