Struct str0m::RtcConfig

source ·
pub struct RtcConfig { /* private fields */ }
Expand description

Customised config for creating an Rtc instance.

use str0m::RtcConfig;

let rtc = RtcConfig::new()
    .ice_lite(true)
    .build();

Configs implement Clone to help create multiple Rtc instances.

Implementations§

Creates a new default config.

Toggle ice lite. Ice lite is a mode for WebRTC servers with public IP address. An Rtc instance in ice lite mode will not make STUN binding requests, but only answer to requests from the remote peer.

See ICE RFC

Defaults to false.

Clear all configured codecs.


// For the session to use only OPUS and VP8.
let mut rtc = RtcConfig::default()
    .clear_codecs()
    .enable_opus()
    .enable_vp8()
    .build();

Enable opus audio codec.

Enabled by default.

Enable VP8 video codec.

Enabled by default.

Enable H264 video codec.

Enabled by default.

Enable VP9 video codec.

Enabled by default.

Lower level access to precis configuration of codecs (payload types).

Set the interval between statistics events This includes Event::MediaEgressStats, Event::MediaIngressStats, Event::MediaEgressStats

Defaults to Duration::from_secs(1).

Create a Rtc from the configuration.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more