summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2024-09-16 01:50:44 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-09-25 23:56:50 +0300
commitf2088eb91fd6477b152233b9031cb115ca1ae824 (patch)
treee93faba242639679c74a5f978b298cc89c395a12
parentab67fdd210e30ad3806f10cb5f6d4e325059f8de (diff)
apps: cam: Print control array sizes
Now that controls can be queried for array information, print it in --list-controls when applicable. Example output (with dummy controls added to vimc): $ cam -c 1 --list-controls Using camera platform/vimc.0 Sensor B as cam0 Control: ColourGains: [1.000000..4.000000] Size: 2 Control: Brightness: [-1.000000..1.000000] Control: AfWindows: [(0, 0)/1x1..(0, 0)/100x100] Size: n Control: Contrast: [0.000000..2.000000] Control: Saturation: [0.000000..2.000000] Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--src/apps/cam/camera_session.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp
index fc092380..d24ecbb3 100644
--- a/src/apps/cam/camera_session.cpp
+++ b/src/apps/cam/camera_session.cpp
@@ -176,6 +176,17 @@ void CameraSession::listControls() const
std::cout << " (" << val << ")" << std::endl;
}
}
+
+ if (id->isArray()) {
+ std::size_t size = id->size();
+
+ std::cout << " Size: ";
+ if (size == std::numeric_limits<std::size_t>::max())
+ std::cout << "n";
+ else
+ std::cout << std::to_string(size);
+ std::cout << std::endl;
+ }
}
}