From patchwork Wed Sep 11 15:35:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 21234 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 18737C324C for ; Wed, 11 Sep 2024 15:35:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4957E634FC; Wed, 11 Sep 2024 17:35:37 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="gLwX1dKj"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 89001634F4 for ; Wed, 11 Sep 2024 17:35:30 +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 EBE0013D7; Wed, 11 Sep 2024 17:34:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726068853; bh=cJgAYfssCVZfxrb0/7cTZTFNYc/HsSeJZouNT/9YJvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gLwX1dKjj/I7aS8rFUZD93J6uQZMS1TFRlQBa3V9kQ3kh5BW63yML4E8oO38OAjmS 7wdZlaXzv7mgl7Y7G6rUsCb+7bYfgDSZS3X62xxvZ3UxDDa3888bz+Zo+Pz8xl2Y/4 MtLNpznrBNf+YgtuQ/8nSnjepbGBWZ+s15FT/RbU= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder Subject: [PATCH 2/2] apps: cam: Print control array sizes Date: Wed, 11 Sep 2024 17:35:23 +0200 Message-Id: <20240911153523.1756554-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240911153523.1756554-1-paul.elder@ideasonboard.com> References: <20240911153523.1756554-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 --- 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; + } } }