diff options
author | Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> | 2022-05-27 17:44:20 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-05-27 22:02:25 +0300 |
commit | ed0d3a9d71acdaf9254fed82032cce26b4534c36 (patch) | |
tree | eac1e6fd69639e6e4c3b2897cf579cff149dffc4 /src/py/cam/cam_qt.py | |
parent | 56f9de149fe32dc25c7628cf78c13095e3aaae84 (diff) |
py: cam: Cleanups
No functional changes. Drop unused variables, reduce typechecker
warnings.
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.py | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/py/cam/cam_qt.py b/src/py/cam/cam_qt.py index 0a25a823..bff1175b 100644 --- a/src/py/cam/cam_qt.py +++ b/src/py/cam/cam_qt.py @@ -184,12 +184,7 @@ class QtRenderer: windows = [] for ctx in self.contexts: - camera = ctx['camera'] - for stream in ctx['streams']: - fmt = stream.configuration.pixel_format - size = stream.configuration.size - window = MainWindow(ctx, stream) window.setAttribute(QtCore.Qt.WA_ShowWithoutActivating) window.show() @@ -199,10 +194,10 @@ class QtRenderer: def run(self): camnotif = QtCore.QSocketNotifier(self.cm.efd, QtCore.QSocketNotifier.Read) - camnotif.activated.connect(lambda x: self.readcam()) + camnotif.activated.connect(lambda _: self.readcam()) keynotif = QtCore.QSocketNotifier(sys.stdin.fileno(), QtCore.QSocketNotifier.Read) - keynotif.activated.connect(lambda x: self.readkey()) + keynotif.activated.connect(lambda _: self.readkey()) print('Capturing...') @@ -292,9 +287,6 @@ class MainWindow(QtWidgets.QWidget): def buf_to_qpixmap(self, stream, fb): with fb.mmap() as mfb: cfg = stream.configuration - w = cfg.size.width - h = cfg.size.height - pitch = cfg.stride if cfg.pixel_format == libcam.formats.MJPEG: img = Image.open(BytesIO(mfb.planes[0])) |