pub struct AdaptiveJitterBufferBuilder<P> { /* private fields */ }Expand description
Builder for JitterBufferInterceptor (exported as AdaptiveJitterBufferBuilder and
AdaptiveJitterBufferInterceptor).
build returns a factory: a closure that takes the inner interceptor and
returns the jitter buffer around it. Apply it with
Interceptor::with to a
PassThroughInterceptor (never a
NoopInterceptor: that is the chain’s RTCP terminus, and inside
this slot it would end the inbound RTCP of every slot after it), and put the result in
Slot::JitterBuffer, the application-most position:
use rtci_interceptor::{
AdaptiveJitterBufferBuilder, Interceptor, PassThroughInterceptor, Registry, Slot,
};
use std::time::Duration;
let jitter = PassThroughInterceptor::new().with(
AdaptiveJitterBufferBuilder::new()
.with_min_delay(Duration::from_millis(20))
.with_max_delay(Duration::from_millis(500))
.with_initial_delay(Duration::from_millis(50))
.build(),
);
let chain = Registry::new().with(Slot::JitterBuffer, jitter).build();Implementations§
Source§impl<P> JitterBufferBuilder<P>
impl<P> JitterBufferBuilder<P>
Sourcepub fn with_min_delay(self, d: Duration) -> Self
pub fn with_min_delay(self, d: Duration) -> Self
Minimum playout delay floor (default 20 ms).
Sourcepub fn with_max_delay(self, d: Duration) -> Self
pub fn with_max_delay(self, d: Duration) -> Self
Maximum playout delay / force-release ceiling (default 500 ms).
Sourcepub fn with_initial_delay(self, d: Duration) -> Self
pub fn with_initial_delay(self, d: Duration) -> Self
Starting target delay before enough packets have been seen to estimate jitter (default 50 ms).
Sourcepub fn build(self) -> impl FnOnce(P) -> JitterBufferInterceptor<P>
pub fn build(self) -> impl FnOnce(P) -> JitterBufferInterceptor<P>
The interceptor factory: a closure that takes the inner interceptor P and returns
the JitterBufferInterceptor around it, for
Interceptor::with.