pub struct Session { /* private fields */ }Expand description
Single RTP session, (1 sender, many receiver)
This can be used to publish a single RTP source and receive others. It manages a jitterbuffer for every remote ssrc and can generate RTCP reports.
Implementations§
Source§impl Session
impl Session
pub fn new(ssrc: u32, clock_rate: u32, cname: String) -> Self
Sourcepub fn clock_rate(&self) -> u32
pub fn clock_rate(&self) -> u32
Clock rate of the RTP timestamp
Sourcepub fn recv_rtp(&mut self, rtp_packet: RtpPacket)
pub fn recv_rtp(&mut self, rtp_packet: RtpPacket)
Receive an RTP packet.
The session consumes the packet and puts in into a internal jitterbuffer to fix potential reordering.
pub fn pop_rtp(&mut self) -> Option<RtpPacket>
pub fn recv_rtcp(&mut self, packet: Packet<'_>)
Sourcepub fn write_rtcp_report(
&mut self,
dst: &mut [u8],
) -> Result<usize, RtcpWriteError>
pub fn write_rtcp_report( &mut self, dst: &mut [u8], ) -> Result<usize, RtcpWriteError>
Generate RTCP sender or receiver report packet.
This resets the internal received & lost packets counter for every receiver.
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.