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§
Provided Methods§
Sourcefn marker_rule(&self) -> MarkerRule
fn marker_rule(&self) -> MarkerRule
Which packets carry the marker bit. Video unless the payloader says otherwise.
Sourcefn payload_duration(&self, _payload: &Bytes) -> Option<u32>
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.
Sourcefn set_next_frame_info(&mut self, _info: &dyn Any)
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§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".