From patchwork Wed Feb 16 12:35:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 15368 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 C07F4BE08A for ; Wed, 16 Feb 2022 12:35:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9DF4E61140; Wed, 16 Feb 2022 13:35:51 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vuOQlH6+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3791661121 for ; Wed, 16 Feb 2022 13:35:49 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D06B5484; Wed, 16 Feb 2022 13:35:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1645014949; bh=o/S6asNw/vtJ1/G6uP6l+lwKSO6icCX6NWJk4FdGOwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vuOQlH6++Br6tHY9uYrXiCP6aPdaNrc1Nru9bvLMHZYGzF4yfPg4vX4qB8f7zW+6j Fd31uE9kzMniF2/x4VpI9Cc1lofmOLggV9OIVc+E6M8ncTPYU0B5LoqmHBEr7Es3Gv ukNB0f8bgTjWS9gTE+z/MehZ806+wZld+3C18tK8= From: Kieran Bingham To: libcamera devel Date: Wed, 16 Feb 2022 12:35:44 +0000 Message-Id: <20220216123544.637834-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220216123544.637834-1-kieran.bingham@ideasonboard.com> References: <20220216123544.637834-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [SimpleCam PATCH 2/2] simple-cam: processRequest: Report Request metadata 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: , Cc: Nejc Galof Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The completed Request can contain extra data associated with the completed capture to report IPA state or properties of the capture to the application. Process and report any metadata that is associated with the request when it completes, to demonstrate the extra metadata available to be processed. Now that there is substantially more information than one line per completed request, start each completed Request with a blank line to separate from previous completions and report the state of the Request itself with its .toString() helper. Suggested-by: Nejc Galof Signed-off-by: Kieran Bingham --- simple-cam.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/simple-cam.cpp b/simple-cam.cpp index e282463c3976..4de1b7de9ced 100644 --- a/simple-cam.cpp +++ b/simple-cam.cpp @@ -46,6 +46,29 @@ static void requestComplete(Request *request) static void processRequest(Request *request) { + std::cout << std::endl + << "Request completed: " << request->toString() << std::endl; + + /* + * When a request has completed, it is populated with a metadata control + * list that allows an application to determine various properties of + * the completed request. This can include the timestamp of the Sensor + * capture, or its gain and exposure values, or properties from the IPA + * such as the state of the 3A algorithms. + * + * ControlValue types have a toString, so to examine each request, print + * all the metadata for inspection. A custom application can parse each + * of these items and process them according to its needs. + */ + const ControlList &requestMetadata = request->metadata(); + for (const auto &ctrl : requestMetadata) { + const ControlId *id = controls::controls.at(ctrl.first); + const ControlValue &value = ctrl.second; + + std::cout << "\t" << id->name() << " = " << value.toString() + << std::endl; + } + /* * Each buffer has its own FrameMetadata to describe its state, or the * usage of each buffer. While in our simple capture we only provide one