Expose desktop output latency and verify hardware clock transitions
This commit is contained in:
1 parent
3083cc05dc
commit
e1bb12d16a
3 files changed
+38
-3
No files matched your search
@@ -33,6 +33,7 @@ public:
|
||||
|
||||
bool isActive() const { return m_active.load(); }
|
||||
quint64 callId() const { return m_callId.load(); }
|
||||
VoiceAudioIo::OutputLatency outputLatency() const { return m_voice.outputLatency(); }
|
||||
|
||||
/* Mute: пир слышит тишину (отправляем нулевые кадры вместо захваченного PCM). */
|
||||
void setMuted(bool muted);
|
||||
|
||||
@@ -506,10 +506,20 @@ void CallWindow::updateDuration() {
|
||||
|
||||
void CallWindow::setAudioStats(int rtt, int buffer, int tempo, int dropped, int underruns,
|
||||
int minimum, int maximum, int reserve) {
|
||||
m_statsLabel->setText(QCoreApplication::translate("ChatGui",
|
||||
QString text = QCoreApplication::translate("ChatGui",
|
||||
"Buffer: %1 ms · Reserve: %2 ms\nOver 10 s: minimum %3 · maximum %4 ms\nSpeed: %5× · RTT: %6 "
|
||||
"ms\nBuffer drops: %7 · Underruns: %8")
|
||||
.arg(buffer).arg(reserve).arg(minimum).arg(maximum)
|
||||
.arg(tempo / 100.0, 0, 'f', 2).arg(rtt).arg(dropped).arg(underruns));
|
||||
.arg(tempo / 100.0, 0, 'f', 2).arg(rtt).arg(dropped).arg(underruns);
|
||||
auto* audio = CallAudioEngine::instance();
|
||||
if (audio->callId() == m_callId) {
|
||||
auto output = audio->outputLatency();
|
||||
auto value = [](int ms) { return ms >= 0 ? QString::number(ms) : QStringLiteral("—"); };
|
||||
QString total = value(output.outputMs);
|
||||
if (output.outputMs >= 0 && !output.measured) total.prepend(QStringLiteral("~"));
|
||||
text += QLatin1Char('\n') + QCoreApplication::translate("ChatGui", "Audio output: %1 ms (includes app queue: %2 ms)")
|
||||
.arg(total).arg(value(output.queueMs));
|
||||
}
|
||||
m_statsLabel->setText(text);
|
||||
m_statsLabel->setVisible(m_state == Active);
|
||||
}
|
||||
Reference in new issue
Block a user