From patchwork Thu Oct 30 16:58:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 24915 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 134F7C3332 for ; Thu, 30 Oct 2025 16:58:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6559660A7A; Thu, 30 Oct 2025 17:58:41 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="S0U7pgV2"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5824E608D9 for ; Thu, 30 Oct 2025 17:58:24 +0100 (CET) Received: from pb-laptop.local (185.221.140.239.nat.pool.zt.hu [185.221.140.239]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 452C71E33 for ; Thu, 30 Oct 2025 17:56:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1761843394; bh=fVyTzTg2dafxpL1k2PuEDr32Z8EkOdBxf1+x/Tt/jZs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=S0U7pgV2bztig15Aj9l9cOEvAjQVXqoHx975MOFQk5xKykDBFlANwZZBeV5G8JllQ FPKZhtGFmJ1WZ2/o75++pPswnC97RFbLZ0UAxWUWq/WsfOFJXVCD6obGbB0djUte3C lyDSDWBlD/QBCgoS0SfEOLn/KN5dX9SZDHkHtl98= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v3 12/22] [DNI] apps: cam: Print `MetadataListPlan` of camera Date: Thu, 30 Oct 2025 17:58:06 +0100 Message-ID: <20251030165816.1095180-13-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251030165816.1095180-1-barnabas.pocze@ideasonboard.com> References: <20251030165816.1095180-1-barnabas.pocze@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" When `--list-controls` is specified, print the set of supported metadata. Reviewed-by: Kieran Bingham --- changes in v3: * print number of elements separately instead of NxM --- src/apps/cam/camera_session.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/apps/cam/camera_session.cpp b/src/apps/cam/camera_session.cpp index 1596a25a3a..0aef3128f2 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -14,6 +14,7 @@ #include #include +#include #include #include "../common/event_loop.h" @@ -228,6 +229,20 @@ void CameraSession::listControls() const std::cout << std::endl; } } + + for (const auto &[id, info] : camera_->metadata()) { + const auto *cid = controls::controls.at(id); + + std::cout << "Metadata: [ out] " << cid->vendor() << "::" << cid->name() + << " type:" << info.type + << " size:" << info.size + << " alignment:" << info.alignment; + + if (info.isArray) + std::cout << " count:" << info.numElements; + + std::cout << std::endl; + } } void CameraSession::listProperties() const