Skip to main content

DecodeTargetSelector

Struct DecodeTargetSelector 

Source
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_intact says 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

Source

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.

Source

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.

Source

pub fn target(&self) -> (u8, u8)

The layers the receiver wants.

Source

pub fn current_decode_target(&self) -> Option<usize>

The decode target being forwarded, once a frame has been.

Source

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.

Source

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.

Source

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.

Source

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).

Trait Implementations§

Source§

impl Clone for DecodeTargetSelector

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DecodeTargetSelector

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.