Skip to main content

RtcpContextHandle

Struct RtcpContextHandle 

Source
pub struct RtcpContextHandle { /* private fields */ }
Expand description

RTCP context handle.

This handle can be shared with an RTCP channel for processing incoming RTCP packets and generating RTCP reports.

Implementations§

Source§

impl RtcpContextHandle

Source

pub fn process_incoming_receiver_report(&self, report: &ReceiverReport)

Process a given receiver report.

Source

pub fn process_incoming_sender_report(&self, report: &SenderReport)

Process a given sender report.

Source

pub fn process_incoming_bye_packet(&self, packet: &ByePacket)

Process a given BYE packet.

Source

pub fn create_rtcp_reports(&mut self) -> Vec<CompoundRtcpPacket>

Create RTCP reports.

This method generates receiver and/or sender reports for all SSRCs that appeared since the last call to this method. If no RTP packets have been sent or received since the last call, empty receiver reports for all active sender SSRCs will be generated. A sender SSRC is considered active if we have sent at least one RTP packet with the SSRC.

The method also generates BYE packets for all active sender SSRCs if the context has been closed. The method will return an empty vector if the context has already been closed and all corresponding BYE packets have been generated.

Source

pub fn close(&self)

Close the RTCP context.

This will generate BYE packets for all active sender SSRCs and stop generating further RTCP reports. A sender SSRC is considered active if we have sent at least one RTP packet with the SSRC.

Source

pub fn poll_closed(&self, cx: &mut Context<'_>) -> Poll<()>

Poll the closed state of the RTCP context.

The method returns Poll::Ready(()) if the close method has been called or the parent RTCP context has been dropped. Otherwise, it returns Poll::Pending. It can be used to register a task waker that will be notified when the context is closed.

There can be only one task waker per the whole context. Only the last registered waker will be notified when the context is closed.

Source

pub fn end_of_stream(&self) -> bool

Check if the end of stream has been reached.

The method checks the end-of-stream condition based on the configured SSRC mode and the reception of BYE packets for the relevant SSRCs.

  • If the input SSRC mode is Specific, the method returns true if BYE packets have been received for all configured input SSRCs.
  • If the input SSRC mode is Ignore, the method returns true if at least one BYE packet has been received.
  • If the input SSRC mode is Any, the method returns true if BYE packets have been received for all currently tracked SSRCs on the receiver side and there is at least one such SSRC.

Trait Implementations§

Source§

impl Clone for RtcpContextHandle

Source§

fn clone(&self) -> RtcpContextHandle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.