QrCodeScanner: parse extra parameters

This commit is contained in:
Jaquee
2017-08-06 16:27:55 +02:00
parent 6f95f8a754
commit 77335b300a
5 changed files with 31 additions and 9 deletions

View File

@@ -110,6 +110,7 @@ void QrScanThread::processVideoFrame(const QVideoFrame &frame)
void QrScanThread::stop()
{
m_running = false;
m_waitCondition.wakeOne();
}
void QrScanThread::addFrame(const QVideoFrame &frame)
@@ -124,9 +125,10 @@ void QrScanThread::run()
QVideoFrame frame;
while(m_running) {
QMutexLocker locker(&m_mutex);
while(m_queue.isEmpty())
while(m_queue.isEmpty() && m_running)
m_waitCondition.wait(&m_mutex);
processVideoFrame(m_queue.takeFirst());
if(!m_queue.isEmpty())
processVideoFrame(m_queue.takeFirst());
}
}