pub struct KeyFrameRequestInterceptor { /* private fields */ }Expand description
Marks inbound RTCP that asks for a key frame — a Picture Loss Indication (RFC 4585 §6.3.1) or
a Full Intra Request (RFC 5104 §4.3.1) — Attribute::DeliverToApplication, so it passes the
chain’s terminus (NoopInterceptor) instead of ending there.
§Why
The terminus ends every inbound RTCP packet no interceptor vouches for, which is right for
reports and feedback the chain itself acts on. A key-frame request is the exception: no
interceptor can act on it, because only the encoder can produce a key frame, and the encoder
is the application (or sits behind it). Swallowed, a receiver that lost its reference picture
asks again and again while the sender never hears it, and the picture stays broken until the
next scheduled key frame. So the requests are delivered: the application reads them as
RTCMessage::RtcpPacket (the whole compound packet the request arrived in).
§Repeated full intra requests
A FIR is a command with a sequence number (RFC 5104 section 4.3.1): the requester repeats it, with the same number, until it sees the key frame, and “the encoder … does not need to act on a repetition”. An FCI entry whose command sequence number is the one last seen from that requester for that stream is a repetition and is not delivered again; a FIR left with no entry is taken out of the compound packet. A PLI has no sequence number and is always delivered.
§Where it goes
Slot::KeyFrameRequests, application-ward of every default
interceptor, so each of them has seen the packet first. It only marks packets; it never holds,
drops or generates one, so its position constrains nothing else. Marking an already marked
packet does nothing, so an application interceptor that marks the same packets can stay.
§Example
use rtci_interceptor::{KeyFrameRequestInterceptor, Registry, Slot};
let chain = Registry::new()
.with(Slot::KeyFrameRequests, KeyFrameRequestInterceptor::new())
.build();Implementations§
Trait Implementations§
Source§impl Default for KeyFrameRequestInterceptor
impl Default for KeyFrameRequestInterceptor
Source§impl Interceptor for KeyFrameRequestInterceptor
impl Interceptor for KeyFrameRequestInterceptor
Source§fn bind_local_stream(&mut self, _info: &StreamInfo)
fn bind_local_stream(&mut self, _info: &StreamInfo)
Source§fn unbind_local_stream(&mut self, _info: &StreamInfo)
fn unbind_local_stream(&mut self, _info: &StreamInfo)
Source§fn bind_remote_stream(&mut self, _info: &StreamInfo)
fn bind_remote_stream(&mut self, _info: &StreamInfo)
Source§fn unbind_remote_stream(&mut self, _info: &StreamInfo)
fn unbind_remote_stream(&mut self, _info: &StreamInfo)
Source§fn with<O, F>(self, f: F) -> O
fn with<O, F>(self, f: F) -> O
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 moreSource§fn move_local_stream_out(&mut self, info: &StreamInfo)
fn move_local_stream_out(&mut self, info: &StreamInfo)
info moves to another RTP session (its m= section moved to another
transport, as a bundling answer does): it leaves this one without ending, so nothing
says it left (no RTCP BYE, RFC 3550 section 6.6). Unbinds it by default.