recording — functions and constants
How a recording is written, what it carries, and what it did.
A module of its own rather than a type in crate::rule, because
RecordingOptions is not a rule's property: it is the same
struct optris_sdk_imager_start_recording_ex() takes, and the
start_recording_with this crate does not have yet is where it
belongs next. Filing it under the rule that happens to be the first
caller would have made that later addition import from rule.
The snapshot half lives in crate::snapshot, beside
crate::SnapshotOptions, for the same reason.
The finished file
RecordingFile opens an .mkv for the files it carries, with no
camera and no playback, and RecordingFile::attach_files adds
one to a recording that has already been written. Until these
existed a Rust caller could write a recording and could not ask
what was in it -- seven C entry points .NET had and this crate did
not. The whole recording family is now reachable from Rust.
pub fn read_carried_files(path: &str) -> Result<Vec<CarriedFile>>
Every file carried inside a recording or a snapshot, in one call.
For the case where the path came from a folder listing and its kind
is not known in advance: a convenience over RecordingFile and
crate::Snapshot, and the counterpart of .NET's
RecordingAttachments.Read. Prefer the typed opens when the kind
is known: they answer a good deal more than the attachments, and
they do not have to guess from an extension.
The extension decides which reader is used, because the two
containers have nothing in common but what they carry: .mkv is a
recording, .png, .tif and .tiff are snapshots.
Errors
Returns Status::InvalidArgument for any other extension. A
.csv snapshot is write-only and carries nothing to read back, so
it is refused rather than answered with an empty list. Otherwise as
RecordingFile::open or crate::Snapshot::open.