ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
capture_pacing.h
Go to the documentation of this file.
1#pragma once
2#include <stdint.h>
3
4// Keep the last deadline, but rebase after a late blocking read. Returning a
5// deadline in the past makes the next iteration immediately call the blocking
6// capture API again, which can collapse a nominal 33 FPS loop to the camera's
7// much slower retry cadence. The caller must provide interval > 0.
8static inline uint64_t capture_pacing_deadline(uint64_t previous, uint64_t now, uint64_t interval) {
9 uint64_t deadline = previous ? previous + interval : now + interval;
10 if (now > deadline)
11 deadline = now + interval;
12 return deadline;
13}
unsigned long long uint64_t
Definition common.h:63