Skip to main content

FileRecorderOptions

Struct FileRecorderOptions 

Source
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

Source

pub const DEFAULT_DROP_WAIT: Duration

Default cleanup budget from drop or async close submission, including the native stop; drop_wait overrides it.

Source

pub fn source(self, source: SourceSpec) -> Self

Replace the recording source, preserving every other setting.

Source

pub fn clear_format_change_rollover(self) -> Self

Derive format-change rollover from the final naming policy again.

Source

pub fn configured_source(&self) -> &SourceSpec

Requested source descriptor, before any live source change.

Source

pub fn configured_tracks(&self) -> MediaTypes

Requested track types.

Source

pub fn configured_planar_audio(&self) -> bool

Whether planar audio storage was requested.

Source

pub fn configured_format_change_rollover(&self) -> Option<bool>

Explicit rollover choice, or None to derive it from the final naming policy at creation.

Source

pub fn configured_naming(&self) -> &FileNaming

Requested file naming policy.

Source

pub fn configured_proxy(&self) -> bool

Whether recording the proxy was requested.

Source

pub fn configured_rollover_size(&self) -> u64

Requested soft rollover threshold in bytes; zero disables it.

Source

pub fn configured_drop_wait(&self) -> Duration

Requested cleanup budget from drop or async close submission, including the native stop.

Source

pub fn new(source: SourceSpec) -> Self

Record every track of source, including its proxy when it has one, in FileNaming::Indexed files.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn proxy(self, enabled: bool) -> Self

Whether to record the source’s proxy alongside its full-quality video.

Source

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.

Source

pub fn naming(self, naming: FileNaming) -> Self

Set how the recorder names its files: FileNaming::Indexed unless this says otherwise.

Trait Implementations§

Source§

impl Clone for FileRecorderOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FileRecorderOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for FileRecorderOptions

Source§

impl Hash for FileRecorderOptions

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FileRecorderOptions

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FileRecorderOptions

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.