feat: record asynchronously

The record file was written from the stream thread. As a consequence,
any blocking I/O to write the file delayed the decoder.

For maximum performance even when recording is enabled, send
(refcounted) packets to a separate recording thread.
This commit is contained in:
rankun 2020-01-15 14:07:59 +08:00
commit c79a93c429
7 changed files with 189 additions and 16 deletions

View file

@ -53,7 +53,7 @@ bool DeviceManage::disconnectDevice(const QString &serial)
if (!serial.isEmpty() && m_devices.contains(serial)) {
auto it = m_devices.find(serial);
if (it->data()) {
it->data()->deleteLater();
delete it->data();
ret = true;
}
}
@ -66,7 +66,7 @@ void DeviceManage::disconnectAllDevice()
while (i.hasNext()) {
i.next();
if (i.value()) {
i.value()->deleteLater();
delete i.value();
}
}
}