From patchwork Sun Sep 15 23:50:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 21277 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 1B7C6C3261 for ; Sun, 15 Sep 2024 23:51:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0935D634FB; Mon, 16 Sep 2024 01:50:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="CTLKn/Il"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5B99F634FB for ; Mon, 16 Sep 2024 01:50:52 +0200 (CEST) Received: from pyrite.hamster-moth.ts.net (unknown [IPv6:2001:4bc9:a45:b0af:31d1:7a87:7f90:977b]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 69E8AD8B; Mon, 16 Sep 2024 01:49:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726444171; bh=1Iqtbgui5vKHaW0ji4EST6Xx1rOjwlG7X4MePoU0kmk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CTLKn/IlqAnS/BrMwwdKUz32bVGKgM+ZI8XD/s4nV7SQJG3pzkhqiSGWckQr8c0xf wD1tTOBmJywi8qcWj0mcvy0Akuz5Ooqo2UszvaynU/FuSFK9dHpBzL/4YCXV+8nNmm QW2APBUKEUx1A2LHkyM5213QVC2+ajNJpJuK0iUQ= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder , Kieran Bingham , stefan.klug@ideasonboard.com, Laurent Pinchart Subject: [PATCH v3 2/2] apps: cam: Print control array sizes Date: Mon, 16 Sep 2024 01:50:44 +0200 Message-Id: <20240915235044.2188179-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240915235044.2188179-1-paul.elder@ideasonboard.com> References: <20240915235044.2188179-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. 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 Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- Changes in v3: - fix line wrap - add example to commit message No change in v2 --- src/apps/cam/camera_session.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index fc0923801..d24ecbb3a 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::max()) + std::cout << "n"; + else + std::cout << std::to_string(size); + std::cout << std::endl; + } } }