Skip to main content

Vp9LayerFilter

Struct Vp9LayerFilter 

Source
pub struct Vp9LayerFilter { /* private fields */ }
Expand description

Decides which packets of a layered VP9 stream to forward for a target spatial and temporal layer, from the payload descriptor alone (RFC 9628 sections 4.2 and 9).

A middlebox keeps one per receiver and gives it every packet of the stream in order. The rules it applies:

  • a frame above the temporal layer in use is dropped; the temporal layer goes up after a forwarded picture that is a switching up point (U=1) or starts a key picture, and down at once;
  • of the spatial layers below the one in use, a frame is forwarded unless it says no higher layer depends on it (Z=1);
  • the spatial layer goes up at a frame of the wanted layer that does not predict from an earlier picture (P=0) and whose lower-layer dependency (D), if any, was forwarded, in a picture whose frame of the layer in use is such a frame too (a key picture): in any other picture the marker has already been given to the layer in use;
  • it goes down as soon as a frame of the lower layer is decodable for this receiver: at once when the lower layers were being forwarded (full SVC), at that layer’s next P=0 frame otherwise (K-SVC, simulcast in one stream), which the caller asks for with a PLI or FIR when Vp9LayerFilter::needs_key_frame says so.

Nothing is forwarded before a frame the receiver can start from (P=0 and D=0). A stream without layer indices (L=0) is forwarded whole.

Implementations§

Source§

impl Vp9LayerFilter

Source

pub fn new(target_sid: u8, target_tid: u8) -> Self

A filter that selects spatial layer target_sid and the temporal layers up to target_tid.

Source

pub fn set_target(&mut self, target_sid: u8, target_tid: u8)

Changes the target layers. Each takes effect at the next point where the stream allows it (see the type’s description).

Source

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

The target spatial and temporal layer.

Source

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

The spatial and temporal layer forwarded at the moment.

Source

pub fn needs_key_frame(&self) -> bool

Whether the selection cannot be reached without a frame the receiver can start from: nothing has been forwarded yet, or a lower spatial layer is wanted whose frames were not being forwarded. The caller should request a key frame.

Source

pub fn forward(&mut self, descriptor: &Vp9Packet, marker: bool) -> Vp9Forward

Decides for one packet: descriptor is its parsed payload descriptor (a Vp9Packet after Depacketizer::depacketize) and marker its RTP marker bit.

Trait Implementations§

Source§

impl Clone for Vp9LayerFilter

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 Vp9LayerFilter

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Vp9LayerFilter

Source§

impl PartialEq for Vp9LayerFilter

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Vp9LayerFilter

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.