Skip to main content

Payloader

Trait Payloader 

Source
pub trait Payloader:
    Send
    + Sync
    + Debug {
    // Required methods
    fn payload(&mut self, mtu: usize, b: &Bytes) -> Result<Vec<Bytes>>;
    fn clone_to(&self) -> Box<dyn Payloader>;

    // Provided methods
    fn marker_rule(&self) -> MarkerRule { ... }
    fn payload_duration(&self, _payload: &Bytes) -> Option<u32> { ... }
    fn set_next_frame_info(&mut self, _info: &dyn Any) { ... }
}
Expand description

Payloader payloads a byte array for use as rtp.Packet payloads

Required Methods§

Source

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

Splits one encoded frame into payloads no larger than mtu.

§Errors

Fails if the frame is malformed for this codec, or mtu is too small to make progress.

Source

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

Clones this payloader behind a trait object.

Provided Methods§

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).

Trait Implementations§

Source§

impl Clone for Box<dyn Payloader>

Source§

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

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§