From patchwork Tue Dec 17 17:47:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22385 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 38491C32F6 for ; Tue, 17 Dec 2024 17:47:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DE48268000; Tue, 17 Dec 2024 18:47:23 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="Jhm/TodS"; dkim-atps=neutral Received: from mail-10628.protonmail.ch (mail-10628.protonmail.ch [79.135.106.28]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A23D67FF4 for ; Tue, 17 Dec 2024 18:47:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1734457640; x=1734716840; bh=yeWqR3WQB0g1nWWt+Gj1LSg+BkdW2FrSKMmHJ1ogwQ4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=Jhm/TodSBE+tuRi2ILPrtSjAKAdUznictwMbL05Zs4Y2NuM0ajIv+c3RS8jACBUZX ZdqMoTBL3GYtrQvFMzfAuTnMHtjwyBheQ4lGUfMZ5DrYeUrzjJSi3AMsHJ+oBsj9tg AwuryY2+gFBJYVhzLaey7oT+GmCtb1MmToOdQICLn0LCgz+bpR4f3ACDCsC10Ck2Pj 1iuvSAitXtOOoKwwDBHkBDq31O6IvqHsfnwsFZ3iLxZT9+EksVvfDkPAPPfDBdmHi/ 5kQ1to5XE6t1cYDrGbmiZXw4Z+WuKJVj3ET1vmfsfwaS/poKDBm3SLDCZFhGkTNawS 53uGUhFbuHcnA== Date: Tue, 17 Dec 2024 17:47:15 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Cc: Laurent Pinchart , Kieran Bingham Subject: [PATCH v2 2/3] libcamera: virtual: Query number of planes correctly Message-ID: <20241217174707.174777-2-pobrn@protonmail.com> In-Reply-To: <20241217174707.174777-1-pobrn@protonmail.com> References: <20241217174707.174777-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: 1afd3ef31593bf4083c7bcd1318b279c9791a52c 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" `PixelFormatInfo::planes.size()` always returns 3 since `planes` is an array, but that is not the number of planes of the pixel format. Use the `numPlanes()` getter instead. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/virtual/virtual.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp index ce0c38813..987b192c8 100644 --- a/src/libcamera/pipeline/virtual/virtual.cpp +++ b/src/libcamera/pipeline/virtual/virtual.cpp @@ -277,7 +277,7 @@ int PipelineHandlerVirtual::exportFrameBuffers([[maybe_unused]] Camera *camera, const PixelFormatInfo &info = PixelFormatInfo::info(config.pixelFormat); std::vector planeSizes; - for (size_t i = 0; i < info.planes.size(); ++i) + for (size_t i = 0; i < info.numPlanes(); ++i) planeSizes.push_back(info.planeSize(config.size, i)); return dmaBufAllocator_.exportBuffers(config.bufferCount, planeSizes, buffers);