From patchwork Wed Dec 11 15:25:50 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: 22289 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 DCA1ABD80A for ; Wed, 11 Dec 2024 15:25:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8A35F67EB1; Wed, 11 Dec 2024 16:25:57 +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="YJDDzDaW"; dkim-atps=neutral Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7480267EAF for ; Wed, 11 Dec 2024 16:25:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1733930754; x=1734189954; bh=9dLZiyxCFSsxmWXHT9J+DD9fEQsZ2odtHDZ9KO8IyxM=; h=Date:To:From: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=YJDDzDaWhsgFlBP5DETfRzwF1/OYaWna0dUuFWAermoQiFuu53IlV4KMbmN3VA8+N DwAg2R9fzUwo9gUM84jnFJ3W2st0uENzotEHzCoOnqGPpHIy5r5RZXuS2H/G+ueqcv ZO17xjga3aaOVvNZC+L3/YNUUgSNuJBpwnIzU4GvzFoeZANAqMxOZqNs4BDQNPkQCf 0X0WFMQcPNQrolGPMjcHU6oVw9JNdOp8zvitBoKTvEYK8rLcEhkfM3sGNrpMIxL/+b a0ZZj0l0iutvSzhI9HRNyrHJGbBdwrzhrYdyoyqqGzRpYJm8Qn2dAQTA8zinbp1UsR 2kDAsmrIrniZQ== Date: Wed, 11 Dec 2024 15:25:50 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH v1 2/3] libcamera: virtual: Query number of planes correctly Message-ID: <20241211152542.1095857-2-pobrn@protonmail.com> In-Reply-To: <20241211152542.1095857-1-pobrn@protonmail.com> References: <20241211152542.1095857-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: f5f2a4c838910251c779db82801f401fe0bca8fd 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 3126bdd7d..aae94efee 100644 --- a/src/libcamera/pipeline/virtual/virtual.cpp +++ b/src/libcamera/pipeline/virtual/virtual.cpp @@ -278,7 +278,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);