optris::sdk::FrameRateInfo
The rate frames arrive at, what was asked for, and the difference.
Read after the camera is open. A default-constructed instance has valid == false and answers nothing, which is what a source with no camera behind it reports.
Public attributes
valid
bool valid = false
False when there was nothing to report. Every other field is then at its default and means nothing.
sensor_rate_hz
float sensor_rate_hz = 0.0F
The rate the sensor itself streams at in its active operation mode, in Hz. Subsampling happens on the host: the camera keeps sending at this rate whatever is requested.
requested_hz
float requested_hz = 0.0F
The rate that was asked for, in Hz, or 0 when none was -- which is also how a request is cleared. This is the setting as a settings page should show it.
Clamped to sensor_rate_hz when it is read back, so it never reports a rate the camera cannot reach, and it does not survive an operation-mode change as a rate above the new mode's.
effective_hz
float effective_hz = 0.0F
The rate the SDK actually delivers frames at, in Hz. This is the number to divide by when budgeting work per frame.
reason
FrameRateLimitReason reason = FrameRateLimitReason::kUnknown
Why effective_hz is not requested_hz, or that it is.
export_restricted
bool export_restricted = false
Whether this camera is export-restricted, whatever is currently holding the rate.
A different question from reason, and the reason it is a separate field rather than an enumerator. reason answers what limits the rate right now -- a closed set a program branches on. This answers whether the unit is restricted at all, which is a legal property of the hardware and is true whether or not a request is in force.
reason == kExportRestricted implies this, but the converse does not hold: a request below 9 Hz on a restricted camera takes effect and is reported as FrameRateLimitReason::kAsRequested, so before this field existed such a unit was indistinguishable from an unrestricted one for as long as the request stood. The same went for a request of exactly 9, and for the window between the camera opening and the restriction being read off a frame.
One-way, and inherited rather than maintained. It is a direct read of the export cap's own state, and the cap is armed in one direction only -- there is no call in this SDK that takes one out of force. So an application reading this with the frames sees it go false to true on the frame where the restriction takes hold and never go back, across a mode switch or a reconnect. It is armed at the open from the control channel's answer and later from the frames' own marker, so on a camera whose control channel could not be asked it may become true some frames into the stream.
Fail-safe when unknown: a camera that could not be asked counts as restricted, because an unrestricted camera wrongly capped delivers fewer frames and a restricted one wrongly uncapped is an export-law breach.
False on a simulated camera and on a recording: neither is a unit, and reason is FrameRateLimitReason::kNotSupported there.
explanation
std::string explanation
The same reason in words, naming the rates behind it. Never empty when valid.
Names the restriction whenever export_restricted holds, even when the restriction is not what limits the rate -- the case this sentence used to leave out entirely.