summaryrefslogtreecommitdiffstats
path: root/src/plugins/wasapi/qwasapiaudiooutput.h
diff options
context:
space:
mode:
authorMaurice Kalinowski <maurice.kalinowski@qt.io>2016-09-12 16:00:17 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2016-09-13 07:50:20 +0000
commitf92874545bbe79fa72eed773dabc49d109b7b6ca (patch)
tree4833f014d209a47a4dc51fece439e5cbdf0db59b /src/plugins/wasapi/qwasapiaudiooutput.h
parentda7d462e315fb101fc9112a294b5ca2e3bd35a75 (diff)
wasapi: Fix thread affinity
It is expected from the user side that the QIODevice passed to the audio input/output is handled in the very same thread it has been created in. Previously we used the worker thread for it. Instead, schedule handling a buffer to the GUI thread and move on. This also helps simplifying many of the emits, as they happen in the same thread as the target device. Task-number: QTBUG-55894 Change-Id: I552a7a41562dccbaae5681e3c416267165720d30 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/wasapi/qwasapiaudiooutput.h')
-rw-r--r--src/plugins/wasapi/qwasapiaudiooutput.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/wasapi/qwasapiaudiooutput.h b/src/plugins/wasapi/qwasapiaudiooutput.h
index 247a07160..118731af9 100644
--- a/src/plugins/wasapi/qwasapiaudiooutput.h
+++ b/src/plugins/wasapi/qwasapiaudiooutput.h
@@ -89,6 +89,8 @@ public:
qreal volume() const Q_DECL_OVERRIDE;
void process();
+public slots:
+ void processBuffer();
private:
bool initStart(bool pull);
friend class WasapiOutputDevicePrivate;
@@ -113,6 +115,7 @@ private:
quint32 m_bufferBytes;
HANDLE m_event;
QWasapiProcessThread *m_eventThread;
+ QAtomicInt m_processing;
QIODevice *m_eventDevice;
};