OptrisOptrisDocumentation

Documentation/OTC SDK/OTC SDK — C API referencev12.0

optris_sdk_recording_event

One 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 optris_sdk_recording_event_fn, registered with optris_sdk_imager_set_recording_event_callback(). It carries what optris_sdk_recording_fn carries, plus recording_id and statistics.

Why it exists: Why it exists An application that hands each event to a thread of its own, which is what the callback's documentation asks it to do, reads optris_sdk_imager_get_recording_stats() a moment after the STOPPED. If the next recording has started in that moment (an alarm rule's recording action 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. statistics was taken when the recording ended, so it stays the ended recording's: copy it in the callback and read it whenever you like.

Filled by the SDK, never by the caller. struct_size says how much of it this library filled: a program compiled against a later header, with fields appended after statistics, checks it before reading one of those.

Public attributes

struct_size

uint32_t struct_size

sizeof(optris_sdk_recording_event) as this library was built.

phase

optris_sdk_recording_phase phase

What happened, exactly as optris_sdk_recording_fn reports it.

path

const char * path

The file the phase is about. UTF-8, never NULL. Borrowed: valid only until the callback returns.

message

const char * message

Human-readable detail, never NULL, usually empty. The failure on OPTRIS_SDK_RECORDING_FAILED. Borrowed like path.

stop_reason

optris_sdk_recording_stop_reason stop_reason

Who ended the recording, on OPTRIS_SDK_RECORDING_STOPPED; OPTRIS_SDK_RECORDING_STOP_UNKNOWN on every other phase.

reserved0

uint32_t reserved0

Padding. Zero.

recording_id

uint64_t recording_id

Which recording the event is about: the same number on a recording's OPTRIS_SDK_RECORDING_STARTED, on everything it reports in between and on its OPTRIS_SDK_RECORDING_STOPPED, and a different number for every other recording of the same camera handle.

Never 0 for a recording's own events; 0 only on the events of a continuous recording (optris_sdk_imager_start_continuous()), which is a rolling history rather than a recording that starts and stops.

A recording that reaches its segment limit with OPTRIS_SDK_SEGMENT_LIMIT_START_NEW_RECORDING 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 share one.

An identity, not a count: compare two, do not do arithmetic on them.

statistics

const optris_sdk_recording_stats * statistics

The recording's own statistics, as they were when it ended, or NULL.

Set on OPTRIS_SDK_RECORDING_STOPPED and on OPTRIS_SDK_RECORDING_DISCARDED, the two events that end a recording, and NULL on every other phase. Its struct_size is this library's sizeof(optris_sdk_recording_stats). Borrowed: copy what you keep before the callback returns, at most your own sizeof(optris_sdk_recording_stats) and at most its struct_size.

Read this rather than optris_sdk_imager_get_recording_stats() whenever the event is acted on after the callback has returned. The figures are those that call reads at the moment of the stop, except that a recording ended by its segment limit with the next one started (OPTRIS_SDK_RECORDING_STOP_SEGMENT_LIMIT under OPTRIS_SDK_SEGMENT_LIMIT_START_NEW_RECORDING) gets the frame and byte counters of its own file, where the getter counts on across the files from the moment the camera started recording.