Skip to main content

H265MultiStreamDepacketizer

Struct H265MultiStreamDepacketizer 

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

The receiver of an HEVC bitstream carried in several RTP streams: MRST (several streams on one transport) and MRMT (several streams on several transports), RFC 7798 section 4.3: “Receivers MUST support all of SRST, MRST, and MRMT”. It holds the RTP streams of one bitstream, in dependency order, and passes their NAL units on in decoding order as RFC 7798 section 6 describes:

  • When sprop-max-don-diff is greater than 0 for any of the streams, the NAL units of all of them are stored in one de-packetization buffer with their AbsDon (section 4.6, derived along each stream) and leave, the smallest AbsDon first, while the AbsDon values span the highest stream’s sprop-max-don-diff or more (condition A) or the buffer holds more than sprop-depack-buf-nalus NAL units (condition B). Among equal AbsDon values a stream lower in the dependency order goes first.
  • Otherwise the NAL units are passed on in the order of their NTP timestamps; of the same timestamp, a dependee stream’s before a dependent’s, and one stream’s in transmission order. The caller gives each packet’s NTP timestamp (its RTP timestamp mapped through the stream’s sender reports). A NAL unit leaves once no stream can still deliver one that goes before it: every stream it depends on has shown a later timestamp, and every dependent stream received so far the same timestamp or a later one.

Duplicated and outdated packets (a sequence number not after the stream’s last) are removed (section 6). Give each stream’s packets in sequence number order, after the jitter buffer: an MRMT receiver feeds the packets of each transport’s streams into the same instance. The grouping of the streams (which streams make one bitstream and their dependency order) is signalled with RFC 5583 a=depend, which the application reads from the description.

Implementations§

Source§

impl H265MultiStreamDepacketizer

Source

pub fn new(sprop_depack_buf_nalus: u16) -> Self

A receiver whose bitstream has this sprop-depack-buf-nalus (RFC 7798 section 7.1; 0 when the description gives none).

Source

pub fn add_stream(&mut self, id: u32, sprop_max_don_diff: u16)

Adds the RTP stream id (an SSRC, or any number the caller tells the streams apart by) with its sprop-max-don-diff. Streams are added in dependency order: a stream depends only on streams added before it. Adding a stream already held changes nothing.

Source

pub fn len(&self) -> usize

NAL units waiting.

Source

pub fn is_empty(&self) -> bool

Whether no NAL unit is waiting.

Source

pub fn push( &mut self, stream: u32, sequence_number: u16, ntp: u64, payload: &Bytes, ) -> Result<Vec<H265NalUnit>>

Takes one RTP packet of stream stream: its sequence number, its NTP timestamp and its payload. Returns the NAL units now due, in decoding order. A packet of a stream not added, a duplicate and an outdated packet give nothing.

§Errors

As H265Packet::nal_units.

Source

pub fn flush(&mut self) -> Vec<H265NalUnit>

Every NAL unit still waiting, in decoding order: no more packets are coming.

Trait Implementations§

Source§

impl Clone for H265MultiStreamDepacketizer

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 H265MultiStreamDepacketizer

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.