optris::sdk::rec::RecordingEvent
One thing that happened to a recording, delivered as it happens.
This is the only way an application learns that a recording ended on its own duration, was started by an alarm rule, or died on a write error. Polling IsRecording() can see that something changed but never which of the three it was.
Public attributes
phase
RecordingPhase phase = RecordingPhase::kStarted
path
std::string path
The file the phase is about. Never empty.
message
std::string message
Human-readable detail. The reason on the three per-source phases, the failure on RecordingPhase::kFailed, empty otherwise.
source
int source = -1
Which source of a session this is about, or -1 for an event about the recording as a whole.
-1 on every event a single-camera recording produces, which is every event that existed before sessions did. A session's RecordingPhase::kFailed used to be one of those: it said a write had failed and gave no way to tell which of five cameras it had failed for, so an application could report "recording
error" and nothing more useful.
stop_reason
RecordingStopReason stop_reason = RecordingStopReason::kUnknown
Who ended the recording, on RecordingPhase::kStopped.
RecordingStopReason::kUnknown on every other phase, and on a Stopped from a recorder that does not attribute its stops -- see the enum, which says what a reader should do with that.
Appended at the end of the struct deliberately: every RecordingEvent{phase, path, message}in the tree and in an application is a positional aggregate initialiser, and a field inserted beforesource` would silently change what those expressions mean rather than failing to compile.