From patchwork Wed Feb 16 12:35:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 15367 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 36671C3261 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 36BFE6113C; 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="qMYI/Lq2"; 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 F41BB610F8 for ; Wed, 16 Feb 2022 13:35:48 +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 9289C482; 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=1645014948; bh=mIpX4IaHO0YEY0B9M91PqnBwf7+YCBiaqrCIiLl+X10=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qMYI/Lq2WNr3T+18CptP6dal1bgPwJ06ID5BTKTDbEmI9Hvs3OZ4zEhgjKfXuFKsZ RTFfRZ52urtb6XE3dKigvEUvVm9jANFlTXGAxM+sf5bq3y4omDsVdHj4u6Q4KC8uuZ 4Zp/x7NxlXrISXIabME3jBqMaB5VfX2kz9ThC0Aw= From: Kieran Bingham To: libcamera devel Date: Wed, 16 Feb 2022 12:35:43 +0000 Message-Id: <20220216123544.637834-2-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 1/2] simple-cam: processRequest: Report timestamp and enhance description 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" Report the timestamp of the completed buffers when the processRequest() call handles a request and improve the description to discuss more of the operations that can be done here. Signed-off-by: Kieran Bingham Reviewed-by: Paul Elder --- simple-cam.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/simple-cam.cpp b/simple-cam.cpp index 71a715a0c27d..e282463c3976 100644 --- a/simple-cam.cpp +++ b/simple-cam.cpp @@ -46,8 +46,17 @@ static void requestComplete(Request *request) static void processRequest(Request *request) { + /* + * 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 + * buffer per request, a request can have a buffer for each stream that + * is established when configuring the camera. + * + * This allows a viewfinder and a still image to be processed at the + * same time, or to allow obtaining the RAW capture buffer from the + * sensor along with the image as processed by the ISP. + */ const Request::BufferMap &buffers = request->buffers(); - for (auto bufferPair : buffers) { // (Unused) Stream *stream = bufferPair.first; FrameBuffer *buffer = bufferPair.second; @@ -55,6 +64,7 @@ static void processRequest(Request *request) /* Print some information about the buffer which has completed. */ std::cout << " seq: " << std::setw(6) << std::setfill('0') << metadata.sequence + << " timestamp: " << metadata.timestamp << " bytesused: "; unsigned int nplane = 0;