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
impl RtcpContext
Sourcepub fn new(options: RtpTransceiverOptions) -> Self
pub fn new(options: RtpTransceiverOptions) -> Self
Create a new RTCP context.
Sourcepub fn process_outgoing_rtp_packet(&self, packet: &RtpPacket)
pub fn process_outgoing_rtp_packet(&self, packet: &RtpPacket)
Process a given outgoing RTP packet.
Sourcepub fn process_incoming_rtp_packet(&self, packet: &IncomingRtpPacket)
pub fn process_incoming_rtp_packet(&self, packet: &IncomingRtpPacket)
Process a given incoming RTP packet.
Sourcepub fn process_ordered_rtp_packet(&self, packet: &OrderedRtpPacket)
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.
Sourcepub fn close(&self)
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.
Sourcepub fn end_of_stream(&self) -> bool
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.
Sourcepub fn handle(&self) -> RtcpContextHandle
pub fn handle(&self) -> RtcpContextHandle
Create a context handle that can be shared with the companion RTCP channel.