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 follows the cadence (Self::with_cadence: by default 50 to 250 ms, sized to 5% of the media received) or stays fixed at Self::with_interval (false). On by default.

Source

pub fn with_cadence(self, cadence: CongestionFeedbackCadence) -> Self

When feedback is built while the interval is not fixed: see CongestionFeedbackCadence. Default CongestionFeedbackCadence::ReceivedMedia, the engine’s own form, which no specification has. The drafts’ form is CongestionFeedbackCadence::PerFrame (draft-holmer-rmcat-transport-wide-cc-extensions-01 section 3, “It is recommended that a feedback message is sent for every frame received, but in cases of low uplink bandwidth it is acceptable to send them less frequently”, with draft-ietf-rmcat-gcc-02 section 3’s intervals: 30 ms, up to 100 ms): measured worse as the default, it is the StrictRfc behaviour profile’s.

Source

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

The share of the rate it is sized to that the feedback may take with CongestionFeedbackCadence::SendEstimate (of the send estimate) and CongestionFeedbackCadence::ReceivedMedia (of the media received): the interval is the time in which this share holds one feedback packet. Default 0.05 (libwebrtc: “Let TWCC reports occupy 5% of total bandwidth”); the Performance behaviour profile takes 0.025. CongestionFeedbackCadence::PerFrame does not use it.

Source

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

The longest interval of CongestionFeedbackCadence::SendEstimate and CongestionFeedbackCadence::ReceivedMedia while media flows. Default 250 ms (libwebrtc’s kMaxInterval); the Performance behaviour profile takes 500 ms. CongestionFeedbackCadence::PerFrame has the draft’s own ceiling, 100 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.