pub struct NoopInterceptor { /* private fields */ }Expand description
Decides what becomes of inbound RTCP once the interceptors have had it, and passes everything else through.
§Why this exists
Inbound RTCP is for the interceptors: a receiver report feeds the sender-side statistics, a NACK is answered by the responder, transport-wide feedback drives the bandwidth estimate. Handing it onward by default would give an application a stream of control traffic it did not ask for and cannot act on, mixed in with its media — so by default it stops here.
An application that does read RTCP asks for it when building the chain, with
Registry::with_rtcp_readable. See below for why that is
the only way to get it.
§Where this belongs in the chain
Last, so every interceptor that reads RTCP has already seen it by the time it is dropped.
Anywhere else it would starve the ones beyond it — a NACK responder placed after this would
never see a NACK. Registry::build appends it for that reason,
rather than leaving the position to each caller.
§Why an interceptor of your own cannot do it instead
Under the nested chain an application could add an interceptor that kept a copy of each RTCP
packet and returned it from its own poll_read ahead of delegating inward. That worked because
a local poll_read queue was terminal: the copy bypassed everything below and escaped this
one.
On the belt it does not. What an interceptor emits from poll_read rejoins the belt behind
itself, so it arrives here like any other packet and is dropped like any other packet — the
original and the copy, twice over. Since this is always the last interceptor, no position
exists from which to forward past it, which is why the decision belongs to whoever builds the
chain rather than to an interceptor in it.
§Naming
It was a no-op in the nested chain, where its job was to terminate the recursion and hand packets back. The belt needs no terminator, so all that is left is the one decision it always quietly made.
Implementations§
Source§impl NoopInterceptor
impl NoopInterceptor
Sourcepub fn new(rtcp_readable: bool) -> Self
pub fn new(rtcp_readable: bool) -> Self
A terminus.
rtcp_readable decides whether inbound RTCP carries on to the application after every
interceptor has seen it. Registry::build supplies it from
Registry::with_rtcp_readable.