From d711a4c015e74c7a77cfeba17b621909385f4494 Mon Sep 17 00:00:00 2001 From: Yudhistira Erlandinata Date: Tue, 29 Oct 2024 16:07:13 +0000 Subject: libcamera: Extend u16 control type V4L2 Controls support a wide variety of types not yet supported by the ControlValue type system. Extend the libcamera ControlValue types to support an explicit 16 bit unsigned integer type, and map that to the corresponding V4L2_CTRL_TYPE_U16 type within the v4l2_device support class. It's used on some camera metadata that is of length 16-bits, for example JPEG metadata headers. Signed-off-by: Yudhistira Erlandinata Co-developed-by: Harvey Yang Signed-off-by: Harvey Yang Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham Signed-off-by: Kieran Bingham --- include/libcamera/controls.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index fd5005bc..b24336cc 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -29,6 +29,7 @@ enum ControlType { ControlTypeNone, ControlTypeBool, ControlTypeByte, + ControlTypeUnsigned16, ControlTypeUnsigned32, ControlTypeInteger32, ControlTypeInteger64, @@ -63,6 +64,12 @@ struct control_type { static constexpr std::size_t size = 0; }; +template<> +struct control_type { + static constexpr ControlType value = ControlTypeUnsigned16; + static constexpr std::size_t size = 0; +}; + template<> struct control_type { static constexpr ControlType value = ControlTypeUnsigned32; -- cgit v1.2.1