From patchwork Wed Sep 11 16:24:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 21237 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DDA65BF415 for ; Wed, 11 Sep 2024 16:24:23 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 39A86634FC; Wed, 11 Sep 2024 18:24:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="v5UQ4BGn"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AA157634F4 for ; Wed, 11 Sep 2024 18:24:12 +0200 (CEST) Received: from pyrite.hamster-moth.ts.net (213-229-8-243.static.upcbusiness.at [213.229.8.243]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D78B113D7; Wed, 11 Sep 2024 18:22:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726071775; bh=fk8ScSQrWRcDyitoXqV6fKCf2iK1cbrMGJ79s8CEdgc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v5UQ4BGntmEsaiWPpimY/fKB9gGyzYXdnC261vZEeSHqXz2Qm45Ab2Ypa0LzwCAf4 OBtpB0DBAYHdXSE54bhY1fDOz3OLJUasOVcAKseidaHsYXtauqwsQ1Cd/SyFzLx1FV 0n+fMIYAHfF2WmbY3qnc90lU7+KMJRv0dnT8bE2Q= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder , Kieran Bingham Subject: [PATCH v2 2/2] apps: cam: Print control array sizes Date: Wed, 11 Sep 2024 18:24:00 +0200 Message-Id: <20240911162400.1906661-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240911162400.1906661-1-paul.elder@ideasonboard.com> References: <20240911162400.1906661-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Now that controls can be queried for array information, print it in --list-controls when applicable. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- No change in v2 --- 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::max() ? "n" : std::to_string(size)) << std::endl; + } } }