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>
This commit is contained in:
committed by
Laurent Pinchart
parent
86a47fdcd9
commit
8708904fad
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user