Диагностика задержек программного видео на desktop

This commit is contained in:
evgeny committed 2026-10-18 16:17:51 +02:00
1 parent 03ff431d78
commit 5a55bcb500
3 files changed
+51 -11

No files matched your search

+11 -4
View File
@@ -86,14 +86,21 @@ bool CallVideoEncoder::encode(const QImage& image, uint64_t pts, bool forceKey,
auto replacement = m_prepared.get(); auto& candidate = replacement.encoder;
QElapsedTimer timer; timer.start();
bool ready = candidate && candidate->encode(image, pts, true, frames)
&& frames.size() == 1 && frames.front().key && frames.front().pts == pts
&& !call_video_check_key(&m_format, reinterpret_cast<const uint8_t*>(frames.front().data.constData()), frames.front().data.size());
&& frames.size() == 1 && frames.front().key && frames.front().pts == pts;
const qint64 encodedUs = timer.nsecsElapsed() / 1000;
if (ready) ready = !call_video_check_key(&m_format,
reinterpret_cast<const uint8_t*>(frames.front().data.constData()), frames.front().data.size());
const qint64 verifiedUs = timer.nsecsElapsed() / 1000;
if (ready) {
m_encoder = std::move(candidate); m_config = next; completion.bitrate = m_pendingBitrate;
const qint64 committedUs = timer.nsecsElapsed() / 1000;
DEBUG_INFO(DEBUG_CATEGORY_CALL,
"call video bitrate committed generation=%llu request=%llu bitrate=%u pts=%llu background_ms=%lld commit_ms=%lld bytes=%lld",
"call video bitrate committed generation=%llu request=%llu bitrate=%u pts=%llu background_ms=%lld "
"commit_ms=%lld encode_us=%lld verify_us=%lld retire_us=%lld bytes=%lld",
(unsigned long long)m_format.generation, (unsigned long long)m_request, completion.bitrate,
(unsigned long long)pts, (long long)replacement.elapsed, (long long)timer.elapsed(), (long long)frames.front().data.size());
(unsigned long long)pts, (long long)replacement.elapsed, (long long)(committedUs / 1000),
(long long)encodedUs, (long long)(verifiedUs - encodedUs), (long long)(committedUs - verifiedUs),
(long long)frames.front().data.size());
} else {
m_error = candidate ? candidate->error() : replacement.error;
if (m_error.isEmpty()) m_error = "Replacement encoder did not produce a compatible immediate IDR";