core: better frame pacing function

Details explained in the comments on schedule_render().

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2022-12-15 17:24:14 +00:00
parent 47ffaf0a38
commit a4fae2b60a
2 changed files with 97 additions and 79 deletions

View File

@@ -246,6 +246,9 @@ typedef struct session {
uint64_t last_msc_instant;
/// The last MSC number
uint64_t last_msc;
/// When the currently rendered frame will be displayed.
/// 0 means there is no pending frame.
uint64_t target_msc;
/// When did we render our last frame.
uint64_t last_render;
/// Whether we can perform frame pacing.