From c7c40ed1a35e67e9e87c81ae6648594520b0fa1d Mon Sep 17 00:00:00 2001 From: Umang Jain Date: Mon, 21 Jul 2025 18:18:26 +0530 Subject: [PATCH] apps: cam: Print enum string for camera properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some camera properties might be set as a enumeration for e.g. properties::Location. Instead of printing the int32_t values for the enumeration, print the enum string as well. This will enhance the readability for the user. Signed-off-by: Umang Jain Reviewed-by: Kieran Bingham Tested-by: Kieran Bingham Reviewed-by: Barnabás Pőcze Signed-off-by: Kieran Bingham --- src/apps/cam/camera_session.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index f63fcb22..1596a25a 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -236,7 +236,17 @@ void CameraSession::listProperties() const const ControlId *id = properties::properties.at(key); std::cout << "Property: " << id->name() << " = " - << value.toString() << std::endl; + << value.toString(); + + if (!id->enumerators().empty()) { + int32_t val = value.get(); + const auto &iter = id->enumerators().find(val); + + if (iter != id->enumerators().end()) + std::cout << " (" << iter->second << ")"; + } + + std::cout << std::endl; } }