Skip to main content

RtcpSessionInterceptor

Struct RtcpSessionInterceptor 

Source
pub struct RtcpSessionInterceptor { /* private fields */ }
Expand description

The RTCP session of an endpoint (RFC 3550 section 6, RFC 4585 section 3, RFC 8108).

One interceptor, closest to the wire, is the endpoint’s whole RTCP voice:

  • Identity. One CNAME for every local SSRC (RFC 7022: 96 random bits, Base64), given or generated. Reports and feedback come from the local media SSRCs; an endpoint with none reports from one SSRC the session chooses (never zero, never one in use). Every feedback packet the interceptors above or the application write leaves with the packet sender SSRC of this endpoint (RFC 8108 5.4.1), whatever they filled in.
  • Reports. A sender report for every SSRC that sent RTP in the last two intervals, RTX and FEC SSRCs included; a receiver report otherwise (RFC 3550 6.4). Reception report blocks for the remote streams (RFC 3550 Appendix A.3), an SDES CNAME for every reporting SSRC, XR receiver reference time and DLRR blocks (RFC 3611).
  • Timing. The interval of RFC 3550 6.3 from the member and sender counts, the average packet size and the RTCP bandwidth, randomised, with timer reconsideration and reverse reconsideration; the early feedback rules of RFC 4585 3.5 and T_rr_interval; one timer per local SSRC, aggregated into one compound packet (RFC 8108 5.3).
  • Packets. Everything leaves as a compound packet (SR or RR first, then SDES) unless reduced-size RTCP was negotiated (RFC 5506), kept under the MTU.
  • Membership. Sources heard in RTP and RTCP, their CNAMEs, BYE, the timeout after five intervals, sender status over two; BYE for a local SSRC that stops and for all of them when the endpoint leaves; a collision with one of the endpoint’s own SSRCs.

It replaces SenderReportInterceptor and ReceiverReportInterceptor, which report on fixed timers: a sender or receiver report those (or the application) write is dropped here, the session’s own stand for it.

§Where it goes

Slot::RtcpSession, wire-ward of everything: it counts what leaves (retransmissions and FEC included) and what arrives, and every RTCP packet the chain writes passes it last.

§Inputs and outputs

What a session description negotiates is handed in with the builder or, while running, as an RtcpSessionControl. What the session learns leaves as an RtcpSessionEvent.

Implementations§

Source§

impl RtcpSessionInterceptor

Source

pub fn cname(&self) -> &str

The CNAME this endpoint’s SSRCs are described with.

Trait Implementations§

Source§

impl Interceptor for RtcpSessionInterceptor

Source§

fn bind_local_stream(&mut self, info: &StreamInfo)

A stream this endpoint sends: its SSRC reports from now on, and its RTX and FEC SSRCs from their first packet. A stream unbound a moment ago and bound again with the same SSRC (a renegotiation) carries on: no BYE, and its counts are kept.

Source§

fn unbind_local_stream(&mut self, info: &StreamInfo)

The stream stopped: its SSRCs say BYE the next time the chain is driven, unless they are bound again first.

Source§

fn move_local_stream_out(&mut self, info: &StreamInfo)

A stream moving to another RTP session is not leaving: its SSRCs go from this session’s members without the BYE unbind_local_stream sends (RFC 3550 6.6 is for a source that leaves the session; this one carries on in the other session, and this session’s transport is going away or no longer carries it).

Source§

fn bind_remote_stream(&mut self, info: &StreamInfo)

bind_remote_stream lets you modify any incoming RTP packets. It is called once for per RemoteStream. The returned method will be called once per rtp packet.
Source§

fn unbind_remote_stream(&mut self, info: &StreamInfo)

unbind_remote_stream is called when the Stream is removed. It can be used to clean up any data related to that track.
Source§

fn with<O, F>(self, f: F) -> O
where Self: Sized, F: FnOnce(Self) -> O, O: Interceptor,

Wraps this interceptor in an outer one built by f, for nested (#[next]-field) interceptors written with the Interceptor derive. The result is an ordinary interceptor and can be placed in a Registry slot. Read more
Source§

impl Protocol<TransportMessage<AttributedPacket>, TransportMessage<AttributedPacket>, ()> for RtcpSessionInterceptor

Source§

type Rout = TransportMessage<AttributedPacket>

Output read message type Read more
Source§

type Wout = TransportMessage<AttributedPacket>

Output write message type Read more
Source§

type Eout = ()

Output event type Read more
Source§

type Error = Error

Error type for protocol operations
Source§

type Time = Instant

Time/Instant type for timeout handling Read more
Source§

fn handle_read(&mut self, msg: TaggedPacket) -> Result<(), Self::Error>

Handle an incoming read message. Read more
Source§

fn poll_read(&mut self) -> Option<Self::Rout>

Poll for a processed read message. Read more
Source§

fn handle_write(&mut self, msg: TaggedPacket) -> Result<(), Self::Error>

Handle an outgoing write message. Read more
Source§

fn poll_write(&mut self) -> Option<Self::Wout>

Poll for a processed write message. Read more
Source§

fn handle_timeout(&mut self, now: Self::Time) -> Result<(), Self::Error>

Handle a timeout event. Read more
Source§

fn poll_timeout(&mut self) -> Option<Self::Time>

Poll for the next timeout deadline. Read more
Source§

fn handle_event(&mut self, _evt: Ein) -> Result<(), Self::Error>

Handle a custom event. Read more
Source§

fn poll_event(&mut self) -> Option<Self::Eout>

Poll for a generated event. Read more
Source§

fn close(&mut self) -> Result<(), Self::Error>

Close the protocol. Read more

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> 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, 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.