Skip to main content

Av1Depacketizer

Struct Av1Depacketizer 

Source
pub struct Av1Depacketizer {
    pub z: bool,
    pub y: bool,
    pub n: bool,
    /* private fields */
}
Expand description

AV1 RTP Depacketizer

Depacketizes AV1 RTP packets into low overhead bitstream format with obu_size fields.

Fields§

§z: bool

Z flag from aggregation header - first OBU is continuation

§y: bool

Y flag from aggregation header - last OBU will continue

§n: bool

N flag from aggregation header - new coded video sequence

Implementations§

Source§

impl Av1Depacketizer

Source

pub fn new() -> Self

An AV1 depacketizer with no buffered fragments.

Trait Implementations§

Source§

impl Clone for Av1Depacketizer

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 Av1Depacketizer

Source§

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

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

impl Default for Av1Depacketizer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Depacketizer for Av1Depacketizer

Source§

fn depacketize(&mut self, payload: &Bytes) -> Result<Bytes>

Depacketize parses an AV1 RTP payload into OBU stream with obu_size_field.

A malformed packet is an error and drops any OBU being reassembled: what follows it cannot be trusted to continue it.

Reference: https://aomediacodec.github.io/av1-rtp-spec/

Source§

fn is_partition_head(&self, payload: &Bytes) -> bool

Whether the packet can start a temporal unit: Z is not set (its first OBU element is not the continuation of a fragment), and that first OBU is not one that only follows a frame header of the same unit (a tile group or a redundant frame header). Z = 0 alone used to count, so a unit whose first packet was lost was taken up from its second.

This is as much as the payload says. A unit whose later frames each start a packet with their own frame header (spatial layers) still looks like a start there; the Dependency Descriptor’s start_of_frame and the RTP timestamp tell those apart.

Source§

fn is_partition_tail(&self, marker: bool, _payload: &Bytes) -> bool

Returns true if marker bit is set (end of frame)

Source§

fn is_key_frame_start(&self, payload: &Bytes) -> bool

A packet with the aggregation header’s N bit set that starts a temporal unit: “N: MUST be set to 1 if the packet is the first packet of a coded video sequence, and MUST be set to 0 otherwise” (AV1 RTP specification, section 4.4). A coded video sequence begins with a key frame and is decoded without anything before it.

Source§

fn has_key_frames(&self) -> bool

Whether frames of this format are predicted from earlier frames, so that a receiver that lost one cannot use what follows until a key frame (a decoder refresh point, RFC 5104 section 2.2) arrives: the video formats. false, the default, is a format whose frames stand alone (audio) or one this depacketizer cannot speak for.

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.