From patchwork Wed Mar 26 07:51:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 23026 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 27DF0C3213 for ; Wed, 26 Mar 2025 07:52:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8BEA56895B; Wed, 26 Mar 2025 08:52:02 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="OXGy+XPU"; 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 7658D617F1 for ; Wed, 26 Mar 2025 08:51:59 +0100 (CET) Received: from neptunite.flets-east.jp (unknown [IPv6:2404:7a81:160:2100:7402:917d:ea0c:6d4c]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BE6FA99F; Wed, 26 Mar 2025 08:50:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1742975411; bh=HTwNF5ZECDgbsbM/c+vkcyeMGKFGEVmUwzMm18jwLSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OXGy+XPUqL+HAM01yWTx0HdAk9MF+/Px0XgDg0qdx9H/LxWXJS0ifPg16nQPwYKQn jtC3EYKiNHIE/CX4YPhXt5p4lXO/QWvgkYd5Buq2PT7CNQoQDrgOuyEKaBBarU4muC pE5ICVBrVgojj28HxPh6bPdhe3vBGkz3+j1i7lV4= From: Paul Elder To: libcamera-devel@lists.libcamera.org Cc: Paul Elder Subject: [PATCH 2/3] libcamera: v4l2_videodevice: Report offset in dequeueBuffer Date: Wed, 26 Mar 2025 16:51:26 +0900 Message-ID: <20250326075129.1705736-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250326075129.1705736-1-paul.elder@ideasonboard.com> References: <20250326075129.1705736-1-paul.elder@ideasonboard.com> 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" Fill in the offset field of the frame metadata so that it the application can read it. Signed-off-by: Paul Elder --- src/libcamera/v4l2_videodevice.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index f5b3fa09d9a0..5d163f7fd853 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1957,10 +1957,13 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer() * The number of planes in the frame buffer and in the * V4L2 buffer is guaranteed to be equal at this point. */ - for (unsigned int i = 0; i < numV4l2Planes; ++i) + for (unsigned int i = 0; i < numV4l2Planes; ++i) { metadata.planes()[i].bytesused = planes[i].bytesused; + metadata.planes()[i].offset = planes[i].data_offset; + } } else { metadata.planes()[0].bytesused = buf.bytesused; + metadata.planes()[0].offset = buf.m.offset; } return buffer;