summaryrefslogtreecommitdiff
path: root/src/qcam/viewfinder.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-23 01:25:20 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-24 10:34:02 +0200
commit275fd5bd33107a10b1e47a0d36d834b390831af0 (patch)
tree3fff6cc018c1cdc2068f6465cb422b755e2b0a60 /src/qcam/viewfinder.h
parent494da4467ddf091d457863cd363067979552d67e (diff)
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 <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam/viewfinder.h')
-rw-r--r--src/qcam/viewfinder.h10
1 files changed, 9 insertions, 1 deletions
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 <stddef.h>
+
#include <QMutex>
#include <QSize>
#include <QWidget>
+#include <libcamera/buffer.h>
#include <libcamera/pixelformats.h>
#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();