From patchwork Mon Jul 21 10:46:18 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: 23886 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 E3E43C332A for ; Mon, 21 Jul 2025 10:47:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1478769003; Mon, 21 Jul 2025 12:47:01 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="b+m9UfKY"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A77B68FF4 for ; Mon, 21 Jul 2025 12:46:36 +0200 (CEST) Received: from pb-laptop.local (185.221.140.39.nat.pool.zt.hu [185.221.140.39]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3819E7979; Mon, 21 Jul 2025 12:45:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1753094759; bh=QPpV0OlWVqdnjpDM0uggmvYKnTZE8aW9f5Hue53ZSTk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b+m9UfKY60zTHzY0UyhkOUGA3lx36OLyFGtfMiUINvez4Pn4CDhMizreOzZYtr6Lw BUX65jHTeR0RvzovJbwFz7ZbU/yfkv7g31v6eubgwmH804WMmg1LzlRUCH6Fkve38j n1cp+CJbbWcS44nEys9ZwjlgFpxoV9ApLFNmJrB8= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi Subject: [RFC PATCH v2 18/22] [DNI] apps: cam: Use Camera::metadataAvailable signal Date: Mon, 21 Jul 2025 12:46:18 +0200 Message-ID: <20250721104622.1550908-19-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250721104622.1550908-1-barnabas.pocze@ideasonboard.com> References: <20250721104622.1550908-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" From: Jacopo Mondi Handle the Camera::metadataAvailable signal and print the metadata list. Use the --metadata option of cam to validate that the metadata list in Request::metadata() matches the accumulated results. --- Original: https://patchwork.libcamera.org/patch/22234/ --- 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 96ab4ca8e..16c735ef4 100644 --- a/src/apps/cam/camera_session.cpp +++ b/src/apps/cam/camera_session.cpp @@ -299,6 +299,17 @@ int CameraSession::start() camera_->requestCompleted.connect(this, &CameraSession::requestComplete); + if (printMetadata_) { + camera_->metadataAvailable.connect(this, [](Request *r, MetadataList::Diff update) { + std::cout << ">> early metadata for " << r->sequence() << " with " << update.size() << " entries {\n"; + for (auto &&[tag, v] : update) { + const auto *id = controls::controls.at(tag); + std::cout << '\t' << id->name() << " = " << v << '\n'; + } + std::cout << "}" << std::endl; + }); + } + #ifdef HAVE_KMS if (options_.isSet(OptDisplay)) sink_ = std::make_unique(options_[OptDisplay].toString());