pub struct DecodeTargetSelector { /* private fields */ }Expand description
Decides, in a forwarder, which frames of a stream to forward to one receiver, from the Dependency Descriptor alone (AV1 RTP specification A.1, A.5 to A.7).
The receiver’s target is a spatial and a temporal layer; the selector maps it to the best
active decode target of the structure in force and forwards the frames that are part of
it. Give it every packet’s descriptor in RTP sequence number order, after the
DependencyDescriptorReader has read it.
- A frame is forwarded when it is part of the decode target in use (its indication is not “not present”) and none of the frames it refers to was withheld from this receiver.
- The decode target changes at a frame with a Switch indication for the wanted target, or at any frame of it when the chain that protects the wanted target is intact for this receiver, that is every frame of the chain was forwarded to it (A.7).
chain_intactsays whether the forwarder itself has received every frame of the chain that protects the target in use. When it has not, a frame the target needs was lost on the way in (A.6), and the forwarder asks for it (NACK) or for a key frame.
Implementations§
Source§impl DecodeTargetSelector
impl DecodeTargetSelector
Sourcepub fn new(spatial_id: u8, temporal_id: u8) -> Self
pub fn new(spatial_id: u8, temporal_id: u8) -> Self
A selector for a receiver that wants spatial layer spatial_id and the temporal layers
up to temporal_id.
Sourcepub fn set_target(&mut self, spatial_id: u8, temporal_id: u8)
pub fn set_target(&mut self, spatial_id: u8, temporal_id: u8)
Changes the layers the receiver wants. It takes effect at the next frame the stream allows a switch at.
Sourcepub fn current_decode_target(&self) -> Option<usize>
pub fn current_decode_target(&self) -> Option<usize>
The decode target being forwarded, once a frame has been.
Sourcepub fn wanted_decode_target(
&self,
structure: &FrameDependencyStructure,
active_decode_targets: u32,
) -> Option<usize>
pub fn wanted_decode_target( &self, structure: &FrameDependencyStructure, active_decode_targets: u32, ) -> Option<usize>
The decode target the receiver’s layers map to in structure, among those active in
active_decode_targets: the one of exactly these layers, or the best below them.
Sourcepub fn switch_pending(&self, reader: &DependencyDescriptorReader) -> bool
pub fn switch_pending(&self, reader: &DependencyDescriptorReader) -> bool
Whether the decode target in use is not the wanted one: the stream has not offered a switch point yet. A forwarder that cannot wait asks the sender for a key frame.
Sourcepub fn chain_intact(&self, reader: &DependencyDescriptorReader) -> bool
pub fn chain_intact(&self, reader: &DependencyDescriptorReader) -> bool
Whether every frame of the chain that protects the decode target in use has been seen
by this selector, as far as the descriptors seen so far tell. false after a loss on
the way in that the target cannot do without, until the missing frame arrives or the
chain starts again. true when the structure has no chains, or before anything was
forwarded.
Sourcepub fn forward(
&mut self,
descriptor: &DependencyDescriptor,
reader: &DependencyDescriptorReader,
) -> bool
pub fn forward( &mut self, descriptor: &DependencyDescriptor, reader: &DependencyDescriptorReader, ) -> bool
Decides whether to forward the packet descriptor was read from. reader is the
reader that read it (for the structure in force and the active decode targets).