From 4e466057e6dca2c3946353d503f4a1d283fbca8b Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Sun, 8 Jun 2025 17:34:59 +0200 Subject: [PATCH] libcamera: fix compilation errors for libcamera v0.5.0 (#169) * libcamera: add support for ControlTypePoint Signed-off-by: Patrick Gehrsitz * libcamera: fix compile error on missing ControlType This adds a runtime error for missing ControlTypes to fix compilation errors if there are new ControlTypes that are not implemented yet. Signed-off-by: Patrick Gehrsitz * chore: remove whitespaces Signed-off-by: Patrick Gehrsitz * libcamera: only use ControlTypePoint for libcamera>=0.3.2 Signed-off-by: Patrick Gehrsitz * fix: add version check to second switch case Signed-off-by: Patrick Gehrsitz * fix: add version check to libcamera_parse_point Signed-off-by: Patrick Gehrsitz * Add AeState to stable LIBCAMERA_CONTROL block Moved AeState from the draft control list to the stable control block for better alignment with finalized controls. * fix: fix backwards compatibility Signed-off-by: Patrick Gehrsitz --------- Signed-off-by: Patrick Gehrsitz Co-authored-by: Surion79 <102791900+Surion79@users.noreply.github.com> --- device/libcamera/options.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/device/libcamera/options.cc b/device/libcamera/options.cc index 7420c61..d31060a 100644 --- a/device/libcamera/options.cc +++ b/device/libcamera/options.cc @@ -50,10 +50,14 @@ static std::map libcamera_control_ids = LIBCAMERA_CONTROL(AfSpeed, "AfSpeed"), LIBCAMERA_CONTROL(AfTrigger, "AfTrigger"), LIBCAMERA_CONTROL(AfState, "AfState"), +#if LIBCAMERA_VERSION_MAJOR == 0 && LIBCAMERA_VERSION_MINOR >= 5 // Support for older libcamera versions + LIBCAMERA_CONTROL(AeState, "AeState"), +#else + LIBCAMERA_DRAFT_CONTROL(AeState), +#endif LIBCAMERA_DRAFT_CONTROL(AePrecaptureTrigger), LIBCAMERA_DRAFT_CONTROL(NoiseReductionMode), LIBCAMERA_DRAFT_CONTROL(ColorCorrectionAberrationMode), - LIBCAMERA_DRAFT_CONTROL(AeState), LIBCAMERA_DRAFT_CONTROL(AwbState), LIBCAMERA_DRAFT_CONTROL(LensShadingMapMode), #if LIBCAMERA_VERSION_MAJOR == 0 && LIBCAMERA_VERSION_MINOR < 1 // Support RasPI bullseye