Диагностика задержек программного видео на desktop
This commit is contained in:
1 parent
03ff431d78
commit
5a55bcb500
3 files changed
+51
-11
No files matched your search
@@ -165,9 +165,9 @@ void CallVideoEngine::transmit() {
|
||||
unsigned excluded = 0;
|
||||
int64_t lastPts = -1;
|
||||
bool forceKey = true;
|
||||
int64_t reportAt = nowUs(), encodeMax = 0;
|
||||
int64_t reportAt = nowUs(), encodeMax = 0, inputAgeMax = 0;
|
||||
uint64_t captureBase = 0;
|
||||
unsigned encodedCount = 0, keyCount = 0, sendBusy = 0, paced = 0;
|
||||
unsigned encodedCount = 0, keyCount = 0, sendBusy = 0, paced = 0, expired = 0;
|
||||
CallVideoCadence cadence;
|
||||
uint64_t wakeSerial = 0;
|
||||
auto idle = [this, &wakeSerial] {
|
||||
@@ -187,13 +187,14 @@ void CallVideoEngine::transmit() {
|
||||
}
|
||||
int64_t now = nowUs();
|
||||
if (now - reportAt >= 1000000) {
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_CALL,
|
||||
DEBUG_DEBUG(DEBUG_CATEGORY_DEBUG,
|
||||
"video capture flow call=%llu interval_us=%lld captured=%llu encoded=%u keys=%u send_busy=%u paced=%u "
|
||||
"encode_max_us=%lld capture_age_us=%lld pts=%lld clock_correction_us=%lld",
|
||||
"expired=%u encode_max_us=%lld input_age_max_us=%lld capture_age_us=%lld pts=%lld clock_correction_us=%lld",
|
||||
(unsigned long long)m->id, (long long)(now - reportAt), (unsigned long long)(captured - captureBase),
|
||||
encodedCount, keyCount, sendBusy, paced, (long long)encodeMax,
|
||||
encodedCount, keyCount, sendBusy, paced, expired, (long long)encodeMax, (long long)inputAgeMax,
|
||||
(long long)(pts >= 0 ? now - pts : 0), (long long)pts, (long long)clockCorrection);
|
||||
reportAt = now; captureBase = captured; encodedCount = keyCount = sendBusy = paced = 0; encodeMax = 0;
|
||||
reportAt = now; captureBase = captured; encodedCount = keyCount = sendBusy = paced = expired = 0;
|
||||
encodeMax = inputAgeMax = 0;
|
||||
}
|
||||
if (revision != userRevision) { userRevision = revision; excluded = 0; }
|
||||
if (format.generation && state.decoded_generation == format.generation && !state.decoded_accepted
|
||||
@@ -238,10 +239,11 @@ void CallVideoEngine::transmit() {
|
||||
if (!cadence.accept(pts)) { lastPts = pts; ++paced; idle(); continue; }
|
||||
if (image.isNull() || nowUs() - pts > CallCameraMaxFrameAgeUs) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_CALL, "video TX skips old capture age_us=%lld", (long long)(nowUs() - pts));
|
||||
lastPts = pts; continue;
|
||||
lastPts = pts; ++expired; continue;
|
||||
}
|
||||
LiveEncodedFrame output; CallVideoRateCompletion completion;
|
||||
int64_t encodeStarted = nowUs();
|
||||
inputAgeMax = std::max(inputAgeMax, encodeStarted - pts);
|
||||
bool encoded = encoder.encode(image, pts, forceKey, output, completion); lastPts = pts;
|
||||
encodeMax = std::max(encodeMax, nowUs() - encodeStarted);
|
||||
if (completion.request) {
|
||||
@@ -259,6 +261,7 @@ void CallVideoEngine::transmit() {
|
||||
if (!m->running || !m->enabled || m->revision != revision || nowUs() - pts > CallCameraMaxFrameAgeUs) {
|
||||
DEBUG_WARN(DEBUG_CATEGORY_CALL, "video TX discards obsolete encoded frame revision=%llu/%llu enabled=%d age_us=%lld",
|
||||
(unsigned long long)revision, (unsigned long long)m->revision, m->enabled, (long long)(nowUs() - pts));
|
||||
++expired;
|
||||
forceKey = true; continue;
|
||||
}
|
||||
forceKey = call_video_port_send(&packet) != 1; }
|
||||
|
||||
Reference in new issue
Block a user