summaryrefslogtreecommitdiff
path: root/src/qcam/viewfinder_gl.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-18 03:21:06 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-08-21 16:20:46 +0300
commit6f09680b256025923cedd50b5fd1a878af2dffd4 (patch)
tree840b340840347c50fc279f54a397f5d8dd608fc2 /src/qcam/viewfinder_gl.cpp
parent93802f600cf4c3bf15c9d044b980927615e800f4 (diff)
qcam: Replace MappedBuffer with Span<uint8_t>
The MappedBuffer structure is a custom container that binds a data pointer with a length. This is exactly what Span is. Use it instead. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam/viewfinder_gl.cpp')
-rw-r--r--src/qcam/viewfinder_gl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp
index add87db8..40226601 100644
--- a/src/qcam/viewfinder_gl.cpp
+++ b/src/qcam/viewfinder_gl.cpp
@@ -110,7 +110,8 @@ QImage ViewFinderGL::getCurrentImage()
return grabFramebuffer();
}
-void ViewFinderGL::render(libcamera::FrameBuffer *buffer, MappedBuffer *map)
+void ViewFinderGL::render(libcamera::FrameBuffer *buffer,
+ libcamera::Span<uint8_t> mem)
{
if (buffer->planes().size() != 1) {
qWarning() << "Multi-planar buffers are not supported";
@@ -120,7 +121,7 @@ void ViewFinderGL::render(libcamera::FrameBuffer *buffer, MappedBuffer *map)
if (buffer_)
renderComplete(buffer_);
- data_ = static_cast<unsigned char *>(map->memory);
+ data_ = mem.data();
/*
* \todo Get the stride from the buffer instead of computing it naively
*/