optris_sdk_measured_frame_rate
How many real frames arrived, over how long.
optris_sdk_frame_rate_info answers what the SDK intends to deliver, and every figure in it is read back from configuration. It cannot know about a shutter cycle, a frame held because the flag was in the way, a frame dropped under load, or a camera that is not keeping up. This is the counted answer.
What counts as a frame
One the SDK delivered and that carried new pixels. A frame with optris_sdk_frame_info::is_repeated_frame set does not count. That is the point: an application counting callbacks gets the callback rate, which does not fall during a shutter cycle because the stream stays continuous.
The algorithm
measured_hz = real_frames / (window_ms / 1000)
a count over a sliding window ending now, half-open at the old end so a periodic source is not overcounted by one. Both numbers on the right are reported, so the rate can be re-derived and its resolution worked out: the count quantises the answer to one frame per window, which is 1000 / window_ms Hz.
The window is long enough to hold at least eight frames at the rate the source is configured for, bounded to between 1 and 4 seconds. A 32 Hz camera is therefore measured over 1 s, a 125 Hz camera over 1 s (0.8 % resolution) and a 4 Hz camera over 2 s rather than over a second that holds four of its frames.
Public attributes
struct_size
uint32_t struct_size
Set to sizeof(optris_sdk_measured_frame_rate).
valid
uint8_t valid
Non-zero when there is something to report. Fewer than two frames have been delivered, or the first arrived too recently to divide by, and every other field is zero and means nothing.
Not the same as a measured zero. A stalled camera reports valid non-zero with measured_hz 0; one that has not started reports valid zero.
reserved0
uint8_t reserved0[3]
Reserved; always zero. Named so the struct has no implicit padding.
measured_hz
float measured_hz
Real frames per second over the window, in Hz.
How often the scene was measured over the last window of wall time. Dips towards zero for the length of a shutter closure and recovers, because during one the scene is not being measured, and falls to zero across a paused replay. Deliberately not smoothed across either: optris_sdk_imager_get_live_frame_rate() is the figure with those intervals left out, and the one to show a user.
delivered_hz
float delivered_hz
All frames per second over the same window, repeats included.
The rate to decide whether the camera is alive. A camera mid-closure has measured_hz near zero and this at the camera's nominal rate; a camera that has actually stopped has both at zero. A consumer that treated a low measured_hz as a lost camera would report every healthy shutter cycle as a fault.
Exactly (real_frames + repeated_frames) / (window_ms / 1000), so it adds no fact that is not already here. Named rather than left for a caller to derive, because the derivation is the part that gets got wrong.
window_ms
float window_ms
The window measured_hz was counted over, in milliseconds.
Shorter than the full window while the stream is younger than it, so a usable figure is available early rather than after four seconds of nothing.
real_frames
uint32_t real_frames
Real frames counted in the window. The numerator of measured_hz.
repeated_frames
uint32_t repeated_frames
Repeated frames delivered in the same window.
Why measured_hz is below optris_sdk_frame_rate_info::effective_hz, when it is. A shutter cycle shows up here; frames lost under load do not, because a frame that was never delivered was never counted either way.
total_real_frames
uint64_t total_real_frames
Every real frame delivered since the stream started.
total_repeated_frames
uint64_t total_repeated_frames
Every repeated frame delivered since the stream started.