From 275fd5bd33107a10b1e47a0d36d834b390831af0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 23 Mar 2020 01:25:20 +0200 Subject: qcam: viewfinder: Add MappedBuffer to store memory mapping information The new MappedBuffer structure replaces the std::pair<> used in the mapped buffers map, and allows passing data to the ViewFinder::display() function in a more structured way. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/qcam/viewfinder.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/qcam/viewfinder.h') diff --git a/src/qcam/viewfinder.h b/src/qcam/viewfinder.h index a019c3a4..735a6b67 100644 --- a/src/qcam/viewfinder.h +++ b/src/qcam/viewfinder.h @@ -7,16 +7,24 @@ #ifndef __QCAM_VIEWFINDER_H__ #define __QCAM_VIEWFINDER_H__ +#include + #include #include #include +#include #include #include "format_converter.h" class QImage; +struct MappedBuffer { + void *memory; + size_t size; +}; + class ViewFinder : public QWidget { public: @@ -24,7 +32,7 @@ public: ~ViewFinder(); int setFormat(const libcamera::PixelFormat &format, const QSize &size); - void display(const unsigned char *rgb, size_t size); + void display(const libcamera::FrameBuffer *buffer, MappedBuffer *map); QImage getCurrentImage(); -- cgit v1.2.1