SessionSource
pub struct SessionSource<'a>
One camera's place in a session, as it is declared.
A borrowing builder rather than an owning record, like
crate::FileToAttach and for the same reason: the ABI's struct
carries const char * pointers that are read during
SessionRecorder::add_source and copied by the SDK before it
returns, so there is nothing for the caller to give away. The
lifetime keeps the strings alive exactly that long and no longer.
SessionSource — methods
pub fn new(width: u32, height: u32, frame_rate: f32) -> Self
A thermal source of this geometry and nominal rate, stamped at hand-over.
frame_rate is what the source says about itself; what it
actually delivers is measured and reported by
SessionSourceInfo.
pub fn color(mut self) -> Self
Declare this source visual rather than thermal.
Nothing in such a track is a measurement. It takes
SessionRecorder::write_color_frame and refuses
SessionRecorder::write_frame rather than converting.
pub fn timestamp_source(mut self, source: SessionTimestampSource) -> Self
Where this source's frames get their session time.
pub fn name(mut self, name: &'a str) -> Self
What the operator calls this camera: "Furnace north".
pub fn model(mut self, model: &'a str) -> Self
Camera model. Written per source, which is the thing a single-camera file's metadata cannot do for N cameras.
pub fn serial(mut self, serial: &'a str) -> Self
Camera serial.
pub fn visual_jpeg_quality(mut self, quality: i32) -> Self
Encode this visual source's track as MJPEG at quality, 2
(best) to 31 (worst), instead of losslessly. Zero, the default,
keeps it lossless.
A higher number makes a smaller file and a coarser picture. The
file says it is lossy, in its metadata and in an OTC_LOSSY
container tag. Ignored on a thermal source, with a warning:
MJPEG is eight bits a sample and a 16-bit temperature cannot go
through it and still be a temperature.