pub struct HevcPayloader { /* private fields */ }Expand description
Packetizes H.265/HEVC NAL units into RTP payloads, fragmenting when needed.
By default the stream is one with sprop-max-don-diff equal to 0: no decoding order
numbers, NAL units in decoding order. HevcPayloader::with_donl makes one for a stream
whose sprop-max-don-diff is greater than 0, where every packet carries them (RFC 7798
sections 4.4.1 to 4.4.3).
Implementations§
Source§impl HevcPayloader
impl HevcPayloader
Sourcepub fn with_donl(initial_don: u16) -> Self
pub fn with_donl(initial_don: u16) -> Self
A payloader for a stream whose sprop-max-don-diff is greater than 0: single NAL unit
packets and the first fragment of a NAL unit carry a DONL, and aggregation packets a
DONL for their first unit and a DOND for each other one (RFC 7798 sections 4.4.1 to
4.4.3). NAL units are sent in the order given, which is decoding order, numbered from
initial_don upwards by one, so every DOND is 0.
Sourcepub fn parse(nalu: &Bytes) -> (Vec<usize>, usize)
pub fn parse(nalu: &Bytes) -> (Vec<usize>, usize)
Locates the NAL unit boundaries in an Annex B buffer.
Returns the offset of each start code and the length of the code that was matched: four-byte codes, or three-byte codes when there is no four-byte one. A stream that mixes the two is not split right by this; the payloader does not use it.
Trait Implementations§
Source§impl Clone for HevcPayloader
impl Clone for HevcPayloader
Source§impl Debug for HevcPayloader
impl Debug for HevcPayloader
Source§impl Default for HevcPayloader
impl Default for HevcPayloader
Source§impl Payloader for HevcPayloader
impl Payloader for HevcPayloader
Source§fn payload(&mut self, mtu: usize, payload: &Bytes) -> Result<Vec<Bytes>>
fn payload(&mut self, mtu: usize, payload: &Bytes) -> Result<Vec<Bytes>>
Payload fragments a H264 packet across one or more byte arrays
Source§fn marker_rule(&self) -> MarkerRule
fn marker_rule(&self) -> MarkerRule
Source§fn payload_duration(&self, _payload: &Bytes) -> Option<u32>
fn payload_duration(&self, _payload: &Bytes) -> Option<u32>
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)
fn set_next_frame_info(&mut self, _info: &dyn Any)
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).