Skip to main content

RtcpContext

Struct RtcpContext 

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

RTCP context.

This struct manages RTCP state, including sender and receiver statistics, source descriptions, and RTCP report generation. It is used for interaction between RTP channels and their corresponding RTCP channels.

The RTCP context is designed to be owned by an RTP channel/transceiver, while a handle to the context can be shared with the RTCP channel for processing incoming RTCP packets and generating RTCP reports.

The context will be closed automatically when dropped.

Implementations§

Source§

impl RtcpContext

Source

pub fn new(options: RtpTransceiverOptions) -> Self

Create a new RTCP context.

Source

pub fn process_outgoing_rtp_packet(&self, packet: &RtpPacket)

Process a given outgoing RTP packet.

Source

pub fn process_incoming_rtp_packet(&self, packet: &IncomingRtpPacket)

Process a given incoming RTP packet.

Source

pub fn process_ordered_rtp_packet(&self, packet: &OrderedRtpPacket)

Process a given incoming RTP packet after reordering.

Note that if the underlying RTP transport is ordered and no packet reordering is needed, the method process_incoming_rtp_packet still needs to be called for each packet before calling this method.

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 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.
Source

pub fn handle(&self) -> RtcpContextHandle

Create a context handle that can be shared with the companion RTCP channel.

Trait Implementations§

Source§

impl Drop for RtcpContext

Source§

fn drop(&mut self)

Executes the destructor for this type. 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> 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, 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.