pub trait Depacketizer {
type Frame;
type Error;
// Required methods
fn push(&mut self, packet: RtpPacket) -> Result<(), Self::Error>;
fn flush(&mut self) -> Result<(), Self::Error>;
fn take(&mut self) -> Result<Option<Self::Frame>, Self::Error>;
// Provided methods
fn map_frame<F, T>(self, f: F) -> MapFrame<Self, F>
where F: FnMut(Self::Frame) -> T,
Self: Sized { ... }
fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
where F: FnMut(Self::Error) -> E,
Self: Sized { ... }
}Expand description
Common trait for de-packetizers.
Depacketizers are responsible for converting RTP packets into media frames.
§Usage
- Push an RTP packet into the depacketizer.
- Take all media frames from the depacketizer.
- Repeat from (1) if needed.
- Flush the depacketizer.
- Take all media frames from the depacketizer.
Required Associated Types§
Required Methods§
Sourcefn push(&mut self, packet: RtpPacket) -> Result<(), Self::Error>
fn push(&mut self, packet: RtpPacket) -> Result<(), Self::Error>
Process a given RTP packet.
§Panics
The method may panic if calling the take method would not return
None.