optris::sdk::rec::RecordingEventDetail
A camera's recording event, with the recording it belongs to and, when it ends that recording, the recording's final statistics. Added in 12.0.15.
Delivered to the handler registered with Recorder::OnRecordingDetail() (or RecordingController::SetRecordingDetailCallback()), for every event the plain RecordingEvent handler gets, and at the same moment.
Why it exists: Why it exists An application that hands each event to a thread of its own, which is what the handler's documentation asks it to do, reads Recorder::GetStatistics() a moment after the Stopped. If the next recording has started in that moment (an alarm rule's RecordingAction activating again, or the application starting the next file at once), the start has already reset the statistics, and a complete file reads as "0 frames written". The figures here were taken when the recording ended, so they stay the ended recording's however late the handler reads them.
imager->Recorder().OnRecordingDetail( [](const rec::RecordingEventDetail &detail) { if (detail.event.phase == rec::RecordingPhase::kStopped && detail.statistics) { std::println("recording {} kept {} frames in {}", detail.recording_id, detail.statistics->frames_written, detail.event.path); } });
A new type rather than new members on RecordingEvent: that struct's size is part of the published interface, and a 12.0 release may add to the interface but not change it.
Public attributes
event
RecordingEvent event
The event exactly as the RecordingEvent handler receives it.
recording_id
uint64_t recording_id = 0
Which recording the event is about: the same number on a recording's RecordingPhase::kStarted, on everything it reports in between and on its RecordingPhase::kStopped, and a different number for every other recording of the same camera object.
Never 0 for a recording's own events. 0 only on the events of a continuous recording (ContinuousRecorder, a rolling history rather than a recording that starts and stops).
A recording that reaches its segment limit with SegmentLimitAction::kStartNewRecording is two recordings, and gets two numbers: the Stopped for the finished file carries the old one and the Started for the next file a new one. The parts of a recording that continues as a series (SegmentLimitAction::kContinueSeries) are one recording and share one number.
An identity, not a count: compare two of them, do not do arithmetic on them. Not the same number as RecordingController::GetRecordingToken().
statistics
std::optional< RecordingStats > statistics
The recording's own statistics, as they were when it ended.
Present on RecordingPhase::kStopped and on RecordingPhase::kDiscarded, which are the two events that end a recording; empty on every other phase. Read these, rather than Recorder::GetStatistics(), whenever the handler might run after the next recording has started.
The same figures GetStatistics() reads at the moment of the stop, with one difference: a recording that ended at its segment limit and started the next one (RecordingStopReason::kSegmentLimit) gets the frame and byte counters of its own file, where GetStatistics() counts on across the files from the moment the camera started recording. The queue figures and RecordingStats::longest_write_ms are those of the whole run in both.