StreamInfo

Struct StreamInfo 

Source
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: u32

Synchronization 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: u8

RTP 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: String

MIME type of the codec (e.g., “video/VP8”, “audio/opus”).

§clock_rate: u32

Clock rate in Hz (e.g., 90000 for video, 48000 for Opus audio).

Used to convert between RTP timestamps and wall-clock time.

§channels: u16

Number of audio channels (0 for video, 1 for mono, 2 for stereo).

§sdp_fmtp_line: String

Format-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

Source§

fn clone(&self) -> StreamInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StreamInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StreamInfo

Source§

fn default() -> StreamInfo

Returns the “default value” for a 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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,