pub struct SampleBuilder<T: Depacketizer> { /* private fields */ }
Expand description

SampleBuilder buffers packets until media frames are complete.

Implementations

Constructs a new SampleBuilder. max_late is how long to wait until we can construct a completed Sample. max_late is measured in RTP packet sequence numbers. A large max_late will result in less packet loss but higher latency. The depacketizer extracts media samples from RTP packets. Several depacketizers are available in package github.com/pion/rtp/codecs.

Adds an RTP Packet to self’s buffer.

Push does not copy the input. If you wish to reuse this memory make sure to copy before calling push

Compiles pushed RTP packets into media samples and then returns the next valid sample (or None if no sample is compiled).

Compiles pushed RTP packets into media samples and then returns the next valid sample with its associated RTP timestamp (or None if no sample is compiled).

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.