pub struct RtpCounters {
pub packets_sent: Arc<AtomicU64>,
pub packets_received: Arc<AtomicU64>,
pub bytes_sent: Arc<AtomicU64>,
pub bytes_received: Arc<AtomicU64>,
pub packets_lost: Arc<AtomicU64>,
pub jitter_us: Arc<AtomicU64>,
pub codec_name: String,
pub highest_seq: Arc<AtomicU32>,
pub expected_packets: Arc<AtomicU64>,
/* private fields */
}Expand description
Thread-safe counters for tracking RTP statistics.
Fields§
§packets_sent: Arc<AtomicU64>Packets sent.
packets_received: Arc<AtomicU64>Packets received.
bytes_sent: Arc<AtomicU64>Bytes sent.
bytes_received: Arc<AtomicU64>Bytes received.
packets_lost: Arc<AtomicU64>Packets lost.
jitter_us: Arc<AtomicU64>Jitter in microseconds.
codec_name: StringCodec name.
highest_seq: Arc<AtomicU32>Extended highest sequence number (upper 16 bits = cycles, lower 16 = seq).
expected_packets: Arc<AtomicU64>Expected packets based on sequence numbers.
Implementations§
Source§impl RtpCounters
impl RtpCounters
Sourcepub fn record_sent(&self, bytes: u64)
pub fn record_sent(&self, bytes: u64)
Record a sent packet.
Sourcepub fn record_received(&self, bytes: u64, seq: u16)
pub fn record_received(&self, bytes: u64, seq: u16)
Record a received packet with proper sequence rollover handling.
This implements RFC 3550 Appendix A.1 extended sequence number algorithm.
Sourcepub fn update_jitter(&self, transit_diff_us: u64)
pub fn update_jitter(&self, transit_diff_us: u64)
Update jitter calculation (RFC 3550 algorithm).
Sourcepub fn extended_highest_seq(&self) -> u32
pub fn extended_highest_seq(&self) -> u32
Get the extended highest sequence number (cycles << 16 | seq).
Sourcepub fn seq_cycles(&self) -> u16
pub fn seq_cycles(&self) -> u16
Get the number of sequence cycles (rollovers).
Trait Implementations§
Source§impl Clone for RtpCounters
impl Clone for RtpCounters
Source§fn clone(&self) -> RtpCounters
fn clone(&self) -> RtpCounters
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RtpCounters
impl Debug for RtpCounters
Auto Trait Implementations§
impl Freeze for RtpCounters
impl RefUnwindSafe for RtpCounters
impl Send for RtpCounters
impl Sync for RtpCounters
impl Unpin for RtpCounters
impl UnsafeUnpin for RtpCounters
impl UnwindSafe for RtpCounters
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