diff options
author | Yudhistira Erlandinata <yerlandinata@chromium.org> | 2024-10-29 16:07:13 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2024-11-28 17:46:50 +0000 |
commit | d711a4c015e74c7a77cfeba17b621909385f4494 (patch) | |
tree | 65f07e828a0e3d8628035dfe7b18da62e3af258c /include | |
parent | 86902b39d7cd6701139f3de3a4ef4da57f2502ed (diff) |
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 <yerlandinata@chromium.org>
Co-developed-by: Harvey Yang <chenghaoyang@chromium.org>
Signed-off-by: Harvey Yang <chenghaoyang@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/controls.h | 7 |
1 files changed, 7 insertions, 0 deletions
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, @@ -64,6 +65,12 @@ struct control_type<uint8_t> { }; template<> +struct control_type<uint16_t> { + static constexpr ControlType value = ControlTypeUnsigned16; + static constexpr std::size_t size = 0; +}; + +template<> struct control_type<uint32_t> { static constexpr ControlType value = ControlTypeUnsigned32; static constexpr std::size_t size = 0; |