OptrisOptrisDocumentation

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

optris::sdk::rec::SessionConfig

Session-wide settings.

Public attributes

output_path

std::string output_path

Output file path (.mkv recommended). Segments are named from it exactly as GlobalConfig::output_path's are.

max_segment_duration_sec

uint32_t max_segment_duration_sec = 0

Roll over into the next file after this much session time. Zero disables duration segmentation.

Measured on the session clock, not on any camera's stamp: two cameras' stamps are not on one clock, so segmenting on one of them would cut the file at a moment that means nothing to the other.

max_segment_bytes

uint64_t max_segment_bytes = 0

Roll over before a file would pass this size. Zero disables it. Any number you like; a session reaches a given size N times faster than one camera does.

A ceiling for the finished file, trailer included; see RecordingOptions::max_segment_bytes.

write_preview

bool write_preview = true

Write a cover image into every file this session produces. See GlobalConfig::write_preview.

The picture is of the first frame the file receives, which in a session is whichever source delivers first. A session is several cameras of one scene, so one of them is a fair preview of the file; which one is not chosen, because the moment the container's header can still take an attachment is the moment the first frame arrives and no later.

queue_depth

uint32_t queue_depth = 32

How deep the hand-over queue is, in frames, across all sources.

Every queued frame is a full copy of the pixels, so this is a memory setting as much as a latency one: 32 frames of a 640x480 sensor is about 20 MB.

backlog_policy

SessionBacklogPolicy backlog_policy = SessionBacklogPolicy::kDropNewest

What to do when that queue is full.

stall_timeout

std::chrono::milliseconds stall_timeout {0}

How long a source may go without a frame before SessionRecorder::GetSourceState() calls it stalled. Zero -- the default -- means never, and every live source stays kLive.

Nothing acts on this. It changes what a getter reports and nothing else: a stalled camera is a fact about the world, and the SDK is not in a position to decide whether the operator wants the session abandoned over it.

clock

std::function< uint64_t()> clock

The session clock: monotonic microseconds, any origin.

Left unset -- the normal case -- the session reads std::chrono::steady_clock, the same clock frame_stamp.h uses for exactly the same reason: a session interval has to survive an NTP step, so it is a stopwatch and not a date. The date is recorded separately and once, as SessionRecorder::GetStartHostTimeUs().

Supply one to drive the session from a clock the application already has -- a PLC tick, a trigger line, a simulation's own time -- or to make a test deterministic instead of timing- dependent. Whatever is supplied must not go backwards.

attachment_provider

AttachmentProvider attachment_provider

Pulled as each file opens, exactly as Recorder::SetAttachmentProvider() describes. The session's own document is written first and is not affected by this.