[PATCH 2/3] libcamera: v4l2_videodevice: Report offset in dequeueBuffer

Paul Elder paul.elder at ideasonboard.com
Wed Mar 26 08:51:26 CET 2025


Fill in the offset field of the frame metadata so that it the
application can read it.

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
 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;
-- 
2.47.2



More information about the libcamera-devel mailing list