Skip to main content

RtcpSessionControl

Enum RtcpSessionControl 

Source
#[non_exhaustive]
pub enum RtcpSessionControl { Start, Cname(String), Bandwidth(RtcpBandwidth), ReducedSize(bool), SrtcpOverhead(usize), TrrInt(Duration), TrrIntCleared, Leave, StreamIdentifiers { ssrc: u32, mid: Option<String>, rid: Option<String>, repaired_rid: Option<String>, }, ClockRateSwitch { current: u32, previous: Vec<u32>, }, StopRepeating { key: u32, }, }
Expand description

What an application (or the peer connection) tells the session while it runs.

It travels as an Attribute::Custom on an empty RTCP packet written into the chain (RtcpSessionControl::into_packet); the session takes it off the belt.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Start

The transport is up: the session joins now, without waiting for a first packet.

§

Cname(String)

The CNAME of this endpoint, the one its session description announces.

§

Bandwidth(RtcpBandwidth)

The negotiated bandwidth (b= lines).

§

ReducedSize(bool)

Whether reduced-size RTCP (a=rtcp-rsize, RFC 5506) was negotiated.

§

SrtcpOverhead(usize)

The octets SRTCP adds to every compound packet: the E flag and SRTCP index, the authentication tag and the MKI. RFC 3711 section 3.4: they are part of the packet size avg_rtcp_size is computed from, the initial estimate included. Give it before Self::Start; 0 (the default) for plain RTCP.

§

TrrInt(Duration)

The negotiated trr-int (RFC 4585 4.2), the minimum interval between regular reports.

§

TrrIntCleared

The negotiation has no trr-int (any more): the interval the session was built with (RtcpSessionBuilder::with_t_rr_interval) applies again.

§

Leave

The endpoint leaves the session: every local SSRC says BYE.

§

StreamIdentifiers

What identifies the local stream ssrc beyond the CNAME: the identification-tag of its m= section (RFC 9143 section 15.1, SDES MID), its RtpStreamId (RFC 8852 section 3.1) and, for a redundancy stream (RTX, FEC), the RepairedRtpStreamId of the stream it repairs (section 3.2). Each given value is an item of the SSRC’s SDES chunk in every compound packet: RFC 9143 section 15 wants the MID “in the first few RTCP packets after joining the session and … regularly thereafter”. All None forgets the SSRC’s items; the items of an SSRC that is no longer bound go when the next ones are given.

Fields

§ssrc: u32

The local SSRC.

§mid: Option<String>

The m= section’s a=mid.

§rid: Option<String>

The RtpStreamId (the encoding’s rid).

§repaired_rid: Option<String>

The RepairedRtpStreamId (the rid of the stream a redundancy stream repairs).

§

ClockRateSwitch

RFC 7160 section 4.1: the local stream current took over from the streams previous because the sender switched to another clock rate (each clock rate has an SSRC of its own). The next compound packet “MUST contain multiple SR packets, the first one containing the mapping for the current clock rate and the subsequent SR packet(s) containing the mapping for the other clock rates seen during the last period”: it leads with current’s report, followed by those of the previous streams that sent lately.

Fields

§current: u32

The SSRC of the clock rate now in use.

§previous: Vec<u32>

The SSRCs of the other clock rates the stream was sent with, still in the session.

§

StopRepeating

Stops the repetitions of the packets written with the RepeatInRegularReports of this key that are still owed (RFC 7728 section 6.4: “stopping such repetition whenever leaving the state”).

Fields

§key: u32

The key the packets were written with.

Implementations§

Source§

impl RtcpSessionControl

Source

pub fn into_packet(self, now: Instant) -> TaggedPacket

The packet that carries this to the session when written into the chain at now.

Trait Implementations§

Source§

impl Clone for RtcpSessionControl

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 RtcpSessionControl

Source§

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

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

impl Eq for RtcpSessionControl

Source§

impl PartialEq for RtcpSessionControl

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 RtcpSessionControl

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.