File indexing completed on 2024-05-12 04:01:33

0001 /*
0002     SPDX-FileCopyrightText: 2022 Volker Krause <vkrause@kde.org>
0003     SPDX-License-Identifier: MIT
0004 */
0005 
0006 #ifndef PRISON_VIDEOSCANNERWORKER_H
0007 #define PRISON_VIDEOSCANNERWORKER_H
0008 
0009 #include "scanresult.h"
0010 
0011 #include <QObject>
0012 #include <QThread>
0013 #include <QVideoFrame>
0014 
0015 namespace Prison
0016 {
0017 
0018 class VideoScannerFrame;
0019 
0020 /** Contains the actual barcode detecting/decoding work,
0021  *  to be run in a secondary thread.
0022  */
0023 class VideoScannerWorker : public QObject
0024 {
0025     Q_OBJECT
0026 public:
0027     explicit VideoScannerWorker(QObject *parent = nullptr);
0028 
0029 Q_SIGNALS:
0030     void scanFrameRequest(const VideoScannerFrame &frame);
0031     void result(const Prison::ScanResult &result);
0032 
0033 public Q_SLOTS:
0034     void slotScanFrame(VideoScannerFrame frame);
0035 };
0036 
0037 /** Thread for executing the VideoScannerWorker. */
0038 class VideoScannerThread : public QThread
0039 {
0040 public:
0041     void run() override;
0042 };
0043 
0044 }
0045 
0046 #endif // PRISON_VIDEOSCANNERWORKER_H