Skip to main content

Av1Payloader

Struct Av1Payloader 

Source
pub struct Av1Payloader {
    pub sequence_header_per_spatial_layer: bool,
}
Expand description

Packetizes AV1 temporal units into RTP payloads.

One call takes one temporal unit in low overhead format (or, with spatial layers, one layer’s frame of it) and never mixes layers in a packet (AV1 RTP section 5): a packet ends where the OBUs’ temporal_id / spatial_id change, and at a sequence header, which starts its own packet. Temporal delimiter, tile list and padding OBUs are dropped and the OBU size fields removed.

Fields§

§sequence_header_per_spatial_layer: bool

Repeats the temporal unit’s sequence header in front of every spatial layer after the first. For an “S” mode (simulcast encodings in one RTP stream) “a sequence header OBU SHOULD be aggregated with each spatial layer”, so that a forwarder can drop the other encodings and still leave a decodable stream (AV1 RTP sections 5 and 6.1). Off by default: an encoder that writes a sequence header per layer needs no help, and with inter-layer prediction the base layer’s is enough.

Implementations§

Source§

impl Av1Payloader

Source

pub fn payload_frames( &mut self, mtu: usize, temporal_unit: &Bytes, ) -> Result<Vec<Av1FramePayloads>>

Packetizes one temporal unit and returns its packets grouped by frame: one group per run of packets of one spatial layer.

This is the unit the Dependency Descriptor describes (AV1 RTP appendix A: “an RTP frame”): start_of_frame belongs on a group’s first payload and end_of_frame on its last. The RTP marker belongs on the last payload of the last group only (AV1 RTP section 4.2). A packet of OBUs without an extension header (a sequence header, metadata) is counted with the frame that follows it.

§Errors

The same as Payloader::payload.

Trait Implementations§

Source§

impl Clone for Av1Payloader

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 Av1Payloader

Source§

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

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

impl Default for Av1Payloader

Source§

fn default() -> Self

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

impl Payloader for Av1Payloader

Source§

fn payload(&mut self, mtu: usize, payload: &Bytes) -> Result<Vec<Bytes>>

Splits one encoded frame into payloads no larger than mtu. Read more
Source§

fn clone_to(&self) -> Box<dyn Payloader>

Clones this payloader behind a trait object.
Source§

fn marker_rule(&self) -> MarkerRule

Which packets carry the marker bit. Video unless the payloader says otherwise.
Source§

fn payload_duration(&self, _payload: &Bytes) -> Option<u32>

For a sample-based format, the RTP timestamp units one payload of payload covers, so that a frame split over several packets gets a timestamp per packet (RFC 3551 section 4.3: the timestamp is the sampling instant of the packet’s first sample). None, the default, is a frame-based format: every packet of the frame carries the frame’s timestamp.
Source§

fn set_next_frame_info(&mut self, _info: &dyn Any)

What the encoder says about the next frame payload is given, for a format whose payload describes more than the frame’s bytes (VP9’s layer indices, Vp9FrameInfo); a type the payloader does not use is ignored, as is the call by a payloader that uses none (the default).

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.