summaryrefslogtreecommitdiff
path: root/src/py/cam/cam_qt.py
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2022-05-27 17:44:24 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-05-27 22:02:41 +0300
commit9e4388cca5d9ecd6152c0d5990038b515b5f918c (patch)
tree433360a1efce3c8a22eef4efeeea590894c7581c /src/py/cam/cam_qt.py
parent210ce547a42ca559592efaef069648ddfe0d2945 (diff)
py: Move MappedFrameBuffer to libcamera.utils
Move MappedFrameBuffer to libcamera.utils, instead of extending FrameBuffer class with a new mmap() method. This keeps us more aligned to the C++ API. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/py/cam/cam_qt.py')
-rw-r--r--src/py/cam/cam_qt.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/py/cam/cam_qt.py b/src/py/cam/cam_qt.py
index bff1175b..70bdb7bb 100644
--- a/src/py/cam/cam_qt.py
+++ b/src/py/cam/cam_qt.py
@@ -9,6 +9,7 @@ from PIL import Image
from PIL.ImageQt import ImageQt
from PyQt5 import QtCore, QtGui, QtWidgets
import libcamera as libcam
+import libcamera.utils
import numpy as np
import sys
@@ -285,7 +286,7 @@ class MainWindow(QtWidgets.QWidget):
controlsLayout.addStretch()
def buf_to_qpixmap(self, stream, fb):
- with fb.mmap() as mfb:
+ with libcamera.utils.MappedFrameBuffer(fb) as mfb:
cfg = stream.configuration
if cfg.pixel_format == libcam.formats.MJPEG: