Skip to main content

Packetizer

Trait Packetizer 

Source
pub trait Packetizer:
    Send
    + Sync
    + Debug {
    // Required methods
    fn enable_abs_send_time(&mut self, value: u8);
    fn packetize(
        &mut self,
        payload: &Bytes,
        samples: u32,
    ) -> Result<Vec<Packet>>;
    fn skip_samples(&mut self, skipped_samples: u32);
    fn clone_to(&self) -> Box<dyn Packetizer>;
}
Expand description

Packetizer packetizes a payload

Required Methods§

Source

fn enable_abs_send_time(&mut self, value: u8)

Attaches the absolute-send-time header extension under id value.

Source

fn packetize(&mut self, payload: &Bytes, samples: u32) -> Result<Vec<Packet>>

Packetizes one frame, advancing the timestamp by samples.

Assigns sequence numbers, sets the marker bit on the final packet, and applies any enabled header extensions.

§Errors

Propagates payloader failures.

Source

fn skip_samples(&mut self, skipped_samples: u32)

Advances the timestamp without sending anything, for dropped or silent frames.

Source

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

Clones this packetizer behind a trait object.

Trait Implementations§

Source§

impl Clone for Box<dyn Packetizer>

Source§

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

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§