summaryrefslogtreecommitdiff
path: root/src/qcam/viewfinder.h
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.h
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.h')
-rw-r--r--src/qcam/viewfinder.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/qcam/viewfinder.h b/src/qcam/viewfinder.h
index 46747c22..42d40f1f 100644
--- a/src/qcam/viewfinder.h
+++ b/src/qcam/viewfinder.h
@@ -11,14 +11,11 @@
#include <QList>
#include <QSize>
+#include <libcamera/base/span.h>
+
#include <libcamera/formats.h>
#include <libcamera/framebuffer.h>
-struct MappedBuffer {
- void *memory;
- size_t size;
-};
-
class ViewFinder
{
public:
@@ -27,7 +24,7 @@ public:
virtual const QList<libcamera::PixelFormat> &nativeFormats() const = 0;
virtual int setFormat(const libcamera::PixelFormat &format, const QSize &size) = 0;
- virtual void render(libcamera::FrameBuffer *buffer, MappedBuffer *map) = 0;
+ virtual void render(libcamera::FrameBuffer *buffer, libcamera::Span<uint8_t> mem) = 0;
virtual void stop() = 0;
virtual QImage getCurrentImage() = 0;