Skip to main content

FormatParams

Struct FormatParams 

Source
pub struct FormatParams {
Show 18 fields pub min_p_time: Option<u8>, pub stereo: Option<bool>, pub sprop_stereo: Option<bool>, pub use_inband_fec: Option<bool>, pub use_dtx: Option<bool>, pub level_asymmetry_allowed: Option<bool>, pub packetization_mode: Option<u8>, pub profile_level_id: Option<u32>, pub profile_id: Option<u32>, pub profile: Option<u8>, pub level_idx: Option<u8>, pub tier: Option<u8>, pub h265_profile_tier_level: Option<H265ProfileTierLevel>, pub h266_profile_tier_level: Option<H266ProfileTierLevel>, pub sprop_max_don_diff: Option<u16>, pub telephone_event_max: Option<u8>, pub octet_align: Option<bool>, pub mode_set: Option<u16>,
}
Expand description

Codec specific format parameters.

Fields§

§min_p_time: Option<u8>

Opus specific parameter.

The minimum duration of media represented by a packet.

§stereo: Option<bool>

Opus specific parameter.

Decoder-side preference for stereo audio. Default is mono per RFC 7587 Section 7.1: https://datatracker.ietf.org/doc/html/rfc7587#section-7.1

§sprop_stereo: Option<bool>

Opus specific parameter.

Sender-side stereo hint for Opus. When set, it signals the intent to transmit stereo from the sender, matching the symmetric m-line model.

§use_inband_fec: Option<bool>

Opus specific parameter.

Specifies that the decoder can do Opus in-band FEC

§use_dtx: Option<bool>

Opus specific parameter.

Specifies that the decoder prefers DTX (Discontinuous Transmission) such that the packet rate is greatly lowered during periods of silence.

§level_asymmetry_allowed: Option<bool>

Whether h264 sending media encoded at a different level in the offerer-to-answerer direction than the level in the answerer-to-offerer direction, is allowed.

§packetization_mode: Option<u8>

What h264 packetization mode is used.

  • 0 - single nal.
  • 1 - STAP-A, FU-A is allowed. Non-interleaved.
§profile_level_id: Option<u32>

H264 profile level.

  • 42 00 1f - 4200=baseline (B) 1f=level 3.1
  • 42 e0 1f - 42e0=constrained baseline (CB) 1f=level 3.1
  • 4d 00 1f - 4d00=main (M) 1f=level 3.1
  • 64 00 1f - 6400=high (H) 1f=level 3.1
§profile_id: Option<u32>

VP9 profile id.

§profile: Option<u8>

AV1 profile.

Indicates the highest AV1 profile that may have been used to generate the bitstream or that the receiver supports. The range of possible values is identical to the seq_profile syntax element specified in AV1. If the parameter is not present, it MUST be inferred to be 0 (“Main” profile).

0 8-bit or 10-bit 4:2:0 1 8-bit or 10-bit 4:4:4 2 8-bit or 10-bit 4:2:2 2 12-bit 4:2:0, 4:2:2, 4:4:4

§level_idx: Option<u8>

AV1 level-idx.

Indicates the highest AV1 level that may have been used to generate the bitstream or that the receiver supports. The range of possible values is identical to the seq_level_idx syntax element specified in AV1. If the parameter is not present, it MUST be inferred to be 5 (level 3.1).

§tier: Option<u8>

AV1 tier.

Indicates the highest tier that may have been used to generate the bitstream or that the receiver supports. The range of possible values is identical to the seq_tier syntax element specified in AV1. If the parameter is not present, the tier MUST be inferred to be 0.

§h265_profile_tier_level: Option<H265ProfileTierLevel>

H.265/HEVC profile, tier, and level.

Contains:

  • profile: Main, Main10, Main Still Picture, etc.
  • tier: Main or High.
  • level: 3.1, 4.0, 5.0, etc.

See ITU-T H.265 Annex A for complete definitions.

§h266_profile_tier_level: Option<H266ProfileTierLevel>

H.266/VVC profile, tier, and level.

Contains:

  • profile: Main 10, Main 10 4:4:4, etc.
  • tier: Main or High.
  • level: 3.1, 4.0, 5.0, etc.

See ITU-T H.266 Annex A and RFC 9328 §7.2 for complete definitions.

§sprop_max_don_diff: Option<u16>

H.265 sprop-max-don-diff parameter (RFC 7798 §7.1). When > 0, DONL fields are included in H.265 RTP packets to support out-of-order NAL unit decoding.

§telephone_event_max: Option<u8>

Highest event code in the inclusive 0-X telephone-event SDP range.

Only contiguous ranges starting at zero are supported. None uses the library default 0-16. Negotiation takes the smaller maximum per payload type across the session.

§octet_align: Option<bool>

AMR-WB octet-align. Some(true) selects the octet-aligned payload layout, otherwise bandwidth-efficient is used.

§mode_set: Option<u16>

AMR-WB mode-set, a bitmask of the allowed speech modes 0..=8.

A mode set from either peer applies to both directions, so only write frames in these modes.

Implementations§

Source§

impl FormatParams

Source

pub fn parse_line(line: &str) -> Self

Parse an fmtp line to create a FormatParams.

Example minptime=10;useinbandfec=1, or 0-16 for telephone events.

Trait Implementations§

Source§

impl Clone for FormatParams

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 Copy for FormatParams

Source§

impl Debug for FormatParams

Source§

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

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

impl Default for FormatParams

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for FormatParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for FormatParams

Source§

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

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

impl Eq for FormatParams

Source§

impl PartialEq for FormatParams

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 Serialize for FormatParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FormatParams

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> CryptoSafe for T
where T: Send + Sync + Debug,

Source§

impl<T> CryptoSafe for T

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

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

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more