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
impl RtcpContextHandle
Sourcepub fn process_incoming_receiver_report(&self, report: &ReceiverReport)
pub fn process_incoming_receiver_report(&self, report: &ReceiverReport)
Process a given receiver report.
Sourcepub fn process_incoming_sender_report(&self, report: &SenderReport)
pub fn process_incoming_sender_report(&self, report: &SenderReport)
Process a given sender report.
Sourcepub fn process_incoming_bye_packet(&self, packet: &ByePacket)
pub fn process_incoming_bye_packet(&self, packet: &ByePacket)
Process a given BYE packet.
Sourcepub fn create_rtcp_reports(&mut self) -> Vec<CompoundRtcpPacket>
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.
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 poll_closed(&self, cx: &mut Context<'_>) -> Poll<()>
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.
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.
Trait Implementations§
Source§impl Clone for RtcpContextHandle
impl Clone for RtcpContextHandle
Source§fn clone(&self) -> RtcpContextHandle
fn clone(&self) -> RtcpContextHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more