Skip to main content

TwccReceiverBuilder

Struct TwccReceiverBuilder 

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

Builder for the TwccReceiverInterceptor.

§Example

use rtci_interceptor::{Slot, Registry, TwccReceiverBuilder};
use std::time::Duration;

let chain = Registry::new()
    .with(Slot::TwccReceiver, TwccReceiverBuilder::new()
        .with_interval(Duration::from_millis(100))
        .build())
    .build();

Implementations§

Source§

impl TwccReceiverBuilder

Source

pub fn new() -> Self

Create a new builder with default settings.

Source

pub fn with_interval(self, interval: Duration) -> Self

Set the interval between feedback reports.

Source

pub fn with_adaptive_interval(self, adaptive_interval: bool) -> Self

Whether the interval stretches to what the RTCP bandwidth holds one feedback packet in. On by default.

All RTCP of an endpoint shares 5% of the session bandwidth (RFC 3550 section 6.2, unless b=RS / b=RR say otherwise), and the RTCP session sends no more than that. At low media rates a tenth of a second of it does not hold a feedback packet, so feedback built every 100 ms queues in the session and reaches the sender late or not at all. With this on, the interval is the configured one where the bandwidth allows it and longer where it does not, up to half a second (“with low uplink bandwidth feedback may be sent less often”, section 3 of the draft): one feedback packet for every RTCP packet the session may send, each covering everything since the last. false keeps the interval fixed.

Source

pub fn with_feedback_share(self, share: f64) -> Self

The share of the media received that the feedback may take while the interval is adaptive: the interval is the time in which this share holds one feedback packet (with its lower layers, and the minimal compound packet around it without reduced-size RTCP). Default 0.05, RFC 3550 section 6.2’s 5% for all of RTCP. A smaller share leaves room in the 5% for the regular reports (the Performance behaviour profile: 0.025).

Source

pub fn with_max_adaptive_interval(self, max_interval: Duration) -> Self

The longest the adaptive interval stretches to while media flows. Default 250 ms. draft-holmer-rmcat-transport-wide-cc-extensions-01 section 3: “in cases of low uplink bandwidth it is acceptable to send them less frequently, e.g., for instance once per RTT”; RFC 8888 section 4 leaves the interval to the application (“Applications need to negotiate an appropriate congestion control feedback interval … based on … the acceptable feedback overhead”). The Performance behaviour profile takes 500 ms.

Source

pub fn with_rereport_received(self, rereport_received: bool) -> Self

Whether a packet an earlier feedback message reported as received is reported as received again when a late packet moves the base sequence number back over it, as libwebrtc does. Off by default: draft-holmer-rmcat-transport-wide-cc-extensions-01 section 3.1.1 has such packets marked “Packet not received”, with no delta. A libwebrtc sender drops a packet from its history once it is reported received, so it ignores the later “not received” either way.

Source

pub fn with_feedback_on_extension_alone(self, extension_alone: bool) -> Self

Whether a remote stream whose packets carry the transport-wide sequence number header extension is reported on although a=rtcp-fb:<pt> transport-cc was not negotiated for it. Off by default: the feedback is an RTCP feedback message, sent only where the session negotiated it (RFC 4585 section 4.2: “MUST NOT” use feedback other than the listed types), and libwebrtc too reports only when the feedback is negotiated beside the extension. On is the fork’s earlier behaviour, for a peer that signals the extension alone.

Source

pub fn build(self) -> TwccReceiverInterceptor

Build the interceptor.

Trait Implementations§

Source§

impl Default for TwccReceiverBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. 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.