pub struct FileRecorderOptions { /* private fields */ }Expand description
Recorder configuration fixed when its native instance is created.
Nothing is checked until a recorder is created from the options, by
FileRecorder::new,
FileRecorder::reset or
AsyncFileRecorder::create. The
options are then checked against each other, so the order of the setter
calls does not matter.
Implementations§
Source§impl FileRecorderOptions
impl FileRecorderOptions
Sourcepub const DEFAULT_DROP_WAIT: Duration
pub const DEFAULT_DROP_WAIT: Duration
Default cleanup budget from drop or async close submission, including
the native stop; drop_wait overrides it.
Sourcepub fn source(self, source: SourceSpec) -> Self
pub fn source(self, source: SourceSpec) -> Self
Replace the recording source, preserving every other setting.
Sourcepub fn clear_format_change_rollover(self) -> Self
pub fn clear_format_change_rollover(self) -> Self
Derive format-change rollover from the final naming policy again.
Sourcepub fn configured_source(&self) -> &SourceSpec
pub fn configured_source(&self) -> &SourceSpec
Requested source descriptor, before any live source change.
Sourcepub fn configured_tracks(&self) -> MediaTypes
pub fn configured_tracks(&self) -> MediaTypes
Requested track types.
Sourcepub fn configured_planar_audio(&self) -> bool
pub fn configured_planar_audio(&self) -> bool
Whether planar audio storage was requested.
Sourcepub fn configured_format_change_rollover(&self) -> Option<bool>
pub fn configured_format_change_rollover(&self) -> Option<bool>
Explicit rollover choice, or None to derive it from the final naming policy at creation.
Sourcepub fn configured_naming(&self) -> &FileNaming
pub fn configured_naming(&self) -> &FileNaming
Requested file naming policy.
Sourcepub fn configured_proxy(&self) -> bool
pub fn configured_proxy(&self) -> bool
Whether recording the proxy was requested.
Sourcepub fn configured_rollover_size(&self) -> u64
pub fn configured_rollover_size(&self) -> u64
Requested soft rollover threshold in bytes; zero disables it.
Sourcepub fn configured_drop_wait(&self) -> Duration
pub fn configured_drop_wait(&self) -> Duration
Requested cleanup budget from drop or async close submission, including the native stop.
Sourcepub fn new(source: SourceSpec) -> Self
pub fn new(source: SourceSpec) -> Self
Record every track of source, including its proxy when it has one,
in FileNaming::Indexed files.
Sourcepub fn drop_wait(self, wait: Duration) -> Self
pub fn drop_wait(self, wait: Duration) -> Self
Set how long dropping the recorder waits for an unfinished session.
The SDK finalizes a file between the stop request and its file-closed
event; destroying the recorder sooner may leave a truncated file. A
recorder dropped with a session still open requests the stop and waits
for closure within one wait budget, measured from drop or an async
close’s submission and including the native stop. The native stop can
itself outlast that budget; only the remaining time is available for
closure events after it returns. Synchronous
FileRecorder::finish instead starts its
wait after the stop returns, giving closure its full requested wait.
Async close shares its budget with any finish or wait already submitted.
Cleanup can end early once there are no known files left to finalize,
subject to StateConflict::IncompleteFileTracking. Duration::ZERO
waits for no future events:
the stop is requested and a bounded nonblocking drain takes queued
events before destruction. FileRecorder::abandon
takes no events.
A wait longer than crate::MAX_TIMEOUT is refused with
Error::InvalidInput when the recorder is created.
Sourcepub fn tracks(self, tracks: MediaTypes) -> Self
pub fn tracks(self, tracks: MediaTypes) -> Self
Select which track types to record: all three unless this says otherwise.
An empty selection is refused with Error::InvalidInput when the
recorder is created, rather than meaning all tracks as it does to the
SDK.
Sourcepub fn planar_audio(self, planar: bool) -> Self
pub fn planar_audio(self, planar: bool) -> Self
Store uncompressed float audio as native planar data when true.
The default interleaved layout is more widely playable by third parties.
Sourcepub fn format_change_rollover(self, enabled: bool) -> Self
pub fn format_change_rollover(self, enabled: bool) -> Self
Whether a change of the source’s format closes the current file and continues the session in a new one.
Left unset, a format change rolls over to a new file when files are
indexed, and closes the file and ends the session when the file name
is exact, because a second file cannot take the same name. With
false a format change always ends the session. A session that ends
this way is reported by RecordingReport::stopped_by_sdk.
true cannot be combined with an exact file name
(FileNaming::Exact, or a FileNaming::Pattern without
{index}): creating the recorder then fails with
Error::InvalidInput.
Index tokens must remain in the file name, as FileNaming::Pattern
requires, so every rollover uses the directory checked at preflight.
Sourcepub fn proxy(self, enabled: bool) -> Self
pub fn proxy(self, enabled: bool) -> Self
Whether to record the source’s proxy alongside its full-quality video.
Sourcepub fn rollover_size(self, bytes: u64) -> Self
pub fn rollover_size(self, bytes: u64) -> Self
Set a soft size threshold, in bytes, for keyframe-aligned rollover; zero disables it.
A nonzero size cannot be combined with an exact file name
(FileNaming::Exact, or a FileNaming::Pattern without
{index}), because the next file would have the same name: creating
the recorder then fails with Error::InvalidInput.
Index tokens must remain in the file name, as FileNaming::Pattern
requires, so every rollover uses the directory checked at preflight.
Sourcepub fn naming(self, naming: FileNaming) -> Self
pub fn naming(self, naming: FileNaming) -> Self
Set how the recorder names its files: FileNaming::Indexed unless
this says otherwise.