summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_videodevice.cpp
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-08-26 20:25:32 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-30 18:08:02 +0300
commit8708904fad6f4ff94a30e2b3b537012b7c637c4d (patch)
tree0fd8f848eeb168ca9054494319d04bd04f74a7ad /src/libcamera/v4l2_videodevice.cpp
parent86a47fdcd97350bd979a4d6b00124330a3b02441 (diff)
libcamera: mapped_framebuffer: Return plane begin address by MappedBuffer::maps()
MappedBuffer::maps() returns std::vector<MappedBuffer::Plane>. Plane has the address, but the address points the beginning of the buffer containing the plane. This makes the Plane point the beginning of the plane. So MappedBuffer::maps()[i].data() returns the address of i-th plane. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index ce60dff6..2ff25af2 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1283,6 +1283,12 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)
FrameBuffer::Plane plane;
plane.fd = std::move(fd);
+ /*
+ * V4L2 API doesn't provide dmabuf offset information of plane.
+ * Set 0 as a placeholder offset.
+ * \todo Set the right offset once V4L2 API provides a way.
+ */
+ plane.offset = 0;
plane.length = multiPlanar ?
buf.m.planes[nplane].length : buf.length;