From 6f09680b256025923cedd50b5fd1a878af2dffd4 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 18 Aug 2021 03:21:06 +0300 Subject: qcam: Replace MappedBuffer with Span 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 Reviewed-by: Paul Elder Reviewed-by: Kieran Bingham --- src/qcam/viewfinder_gl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/qcam/viewfinder_gl.cpp') 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 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(map->memory); + data_ = mem.data(); /* * \todo Get the stride from the buffer instead of computing it naively */ -- cgit v1.2.1