[PATCH 2/2] apps: cam: Print control array sizes
Kieran Bingham
kieran.bingham at ideasonboard.com
Wed Sep 11 18:00:00 CEST 2024
Quoting Paul Elder (2024-09-11 16:35:23)
> Now that controls can be queried for array information, print it in
> --list-controls when applicable.
>
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> ---
> src/apps/cam/camera_session.cpp | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp
> index 37de6c9f3..9c7f84993 100644
> --- a/src/apps/cam/camera_session.cpp
> +++ b/src/apps/cam/camera_session.cpp
> @@ -169,6 +169,11 @@ void CameraSession::listControls() const
> std::cout << " - " << id->enumToString(val) << " (" << val << ")" << std::endl;
> }
> }
> +
> + if (id->isArray()) {
> + std::size_t size = id->size();
> + std::cout << " Size: " << (size == std::numeric_limits<std::size_t>::max() ? "n" : std::to_string(size)) << std::endl;
That's a long line... but it doesn't break down easily ...
std::cout << " Size: "
<< (size == std::numeric_limits<std::size_t>::max() ? "n" : std::to_string(size))
<< std::endl;
but maybe that doesn't help much.
Either way, printing the control information is very helpful. And I'm
looking forward to when applciations can use this to interogate the
controls from UI implementations or otherwise at runtime.
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> + }
> }
> }
>
> --
> 2.39.2
>
More information about the libcamera-devel
mailing list