[client/obs] scheduler: correct phase feedback

Only report the client queue lead when JIT rendering provides a valid
measurement. Clamp linear phase errors instead of wrapping them into the
opposite direction at half of a refresh period.

Timestamp OBS frames after the shared framebuffer becomes ready.
This commit is contained in:
Geoffrey McRae
2026-08-05 11:52:44 +10:00
parent 2c74f4a0f9
commit 12f6485e52
4 changed files with 25 additions and 25 deletions

View File

@@ -505,15 +505,22 @@ static void * frameThread(void * data)
}
}
const uint64_t now = os_gettime_ns();
uint64_t now = os_gettime_ns();
if (status == LGMP_OK)
{
LGMPMessage msg;
if (lgmpClientProcess(this->frameQueue, &msg) == LGMP_OK)
{
const KVMFRFrame * frame = (const KVMFRFrame *)msg.mem;
lgFrameSchedulerObserveFrame(&this->frameScheduler,
frame->frameSerial, msg.udata, now);
const KVMFRFrame * frame = (const KVMFRFrame *)msg.mem;
const FrameBuffer * fb =
(const FrameBuffer *)((const uint8_t *)frame + frame->offset);
if (framebuffer_wait(
fb, (size_t)frame->dataHeight * frame->pitch))
{
now = os_gettime_ns();
lgFrameSchedulerObserveFrame(&this->frameScheduler,
frame->frameSerial, msg.udata, now);
}
}
}
@@ -1287,8 +1294,6 @@ static void lgVideoTick(void * data, float seconds)
}
const KVMFRFrame * frame = (KVMFRFrame *)msg.mem;
lgFrameSchedulerObserveFrame(&this->frameScheduler,
frame->frameSerial, msg.udata, tickTime);
lgFrameSchedulerFeedback(&this->frameScheduler,
frame->frameSerial, msg.udata, tickTime);