From patchwork Thu Sep 9 12:14:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 13785 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 369BDBDB1D for ; Thu, 9 Sep 2021 12:14:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8216D6916E; Thu, 9 Sep 2021 14:14:53 +0200 (CEST) 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="VqkqQApy"; 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 917056916B for ; Thu, 9 Sep 2021 14:14:51 +0200 (CEST) Received: from Monstersaurus.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0F62D883; Thu, 9 Sep 2021 14:14:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1631189691; bh=8fc2GsUoFEqtXTYhM5QKj4JEPDAfJvvq/MG/tzKHJDA=; h=From:To:Cc:Subject:Date:From; b=VqkqQApyuaI39tHCci7xI9nHUP0mjOit4UK43MpCeJQ4P+1df+aWbENqEOnqESQl5 FNgaD89+Xf9eE2SNybAnCUqB7Hd/aa/tLTNWbCejdS4PZt0jGLAIUDZ09+qOeFcww5 Bx/v7YybX/hs5zI7CiZ27EOR0wfD2Wj8OxJBcPMw= From: Kieran Bingham To: libcamera devel Date: Thu, 9 Sep 2021 13:14:47 +0100 Message-Id: <20210909121447.3888276-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [SimpleCam PATCH] simple-cam: Use new metadata API 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" In libcamera commit 32635054bc76 ("libcamera: framebuffer: Prevent modifying the number of metadata planes"), the planes are returned as a const span rather than a vector from the metadata. This provides better protection on the underlying structures, but was a break in the API. Update simple-cam to use the new API. Signed-off-by: Kieran Bingham Reviewed-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart --- simple-cam.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simple-cam.cpp b/simple-cam.cpp index a8ac3c83ccb5..95e472b4377a 100644 --- a/simple-cam.cpp +++ b/simple-cam.cpp @@ -58,10 +58,10 @@ static void processRequest(Request *request) << " bytesused: "; unsigned int nplane = 0; - for (const FrameMetadata::Plane &plane : metadata.planes) + for (const FrameMetadata::Plane &plane : metadata.planes()) { std::cout << plane.bytesused; - if (++nplane < metadata.planes.size()) + if (++nplane < metadata.planes().size()) std::cout << "/"; }