pub struct StreamInfo {
pub ssrc: u32,
pub ssrc_rtx: Option<u32>,
pub ssrc_fec: Option<u32>,
pub payload_type: u8,
pub payload_type_rtx: Option<u8>,
pub payload_type_fec: Option<u8>,
pub rtp_header_extensions: Vec<RTPHeaderExtension>,
pub mime_type: String,
pub clock_rate: u32,
pub channels: u16,
pub sdp_fmtp_line: String,
pub rtcp_feedback: Vec<RTCPFeedback>,
}Expand description
Stream context passed to interceptor bind/unbind callbacks.
Contains all relevant information about a media stream (audio or video) when it’s bound to or unbound from an interceptor. This includes codec parameters, SSRC, RTP extensions, and RTCP feedback mechanisms.
Used by Interceptor::bind_local_stream,
Interceptor::unbind_local_stream,
Interceptor::bind_remote_stream, and
Interceptor::unbind_remote_stream.
§Example
use rtc_interceptor::{StreamInfo, RTCPFeedback, RTPHeaderExtension};
let info = StreamInfo {
ssrc: 0x12345678,
clock_rate: 90000,
mime_type: "video/VP8".to_string(),
payload_type: 96,
// Enable NACK for retransmission
rtcp_feedback: vec![RTCPFeedback {
typ: "nack".to_string(),
parameter: String::new(),
}],
..Default::default()
};Fields§
§ssrc: u32Synchronization Source identifier (SSRC) of the stream.
Uniquely identifies the source of an RTP stream within an RTP session.
ssrc_rtx: Option<u32>RTX (Retransmission) SSRC for RFC 4588 retransmission.
When set, retransmissions will use this separate SSRC instead of the original stream’s SSRC. This allows the receiver to distinguish between original and retransmitted packets.
ssrc_fec: Option<u32>FEC (Forward Error Correction) SSRC.
SSRC used for FEC packets if separate-stream FEC is configured.
payload_type: u8RTP payload type (e.g., 96 for VP8, 111 for Opus).
Dynamic payload types (96-127) are typically used for modern codecs.
payload_type_rtx: Option<u8>RTX payload type for RFC 4588 retransmission.
When set along with ssrc_rtx, retransmitted packets will use this
payload type to distinguish them from original packets.
payload_type_fec: Option<u8>FEC payload type.
Payload type used for FEC packets if configured.
rtp_header_extensions: Vec<RTPHeaderExtension>Negotiated RTP header extensions for this stream.
Contains the list of header extensions that can be used with this stream, such as TWCC sequence numbers, audio levels, or video orientation.
mime_type: StringMIME type of the codec (e.g., “video/VP8”, “audio/opus”).
clock_rate: u32Clock rate in Hz (e.g., 90000 for video, 48000 for Opus audio).
Used to convert between RTP timestamps and wall-clock time.
channels: u16Number of audio channels (0 for video, 1 for mono, 2 for stereo).
sdp_fmtp_line: StringFormat-specific parameters from SDP (fmtp line).
Contains codec-specific parameters like “profile-level-id” for H.264 or “minptime” for audio codecs.
rtcp_feedback: Vec<RTCPFeedback>RTCP feedback mechanisms negotiated for this stream.
Specifies which RTCP feedback types (NACK, PLI, REMB, etc.) are supported for this stream.
Trait Implementations§
Source§impl Clone for StreamInfo
impl Clone for StreamInfo
Source§fn clone(&self) -> StreamInfo
fn clone(&self) -> StreamInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more