xref: /webrtc/interceptor/src/stream_info.rs (revision ffe74184)
1 use crate::Attributes;
2 
3 /// RTPHeaderExtension represents a negotiated RFC5285 RTP header extension.
4 #[derive(Default, Debug, Clone)]
5 pub struct RTPHeaderExtension {
6     pub uri: String,
7     pub id: isize,
8 }
9 
10 /// StreamInfo is the Context passed when a StreamLocal or StreamRemote has been Binded or Unbinded
11 #[derive(Default, Debug, Clone)]
12 pub struct StreamInfo {
13     pub id: String,
14     pub attributes: Attributes,
15     pub ssrc: u32,
16     pub payload_type: u8,
17     pub rtp_header_extensions: Vec<RTPHeaderExtension>,
18     pub mime_type: String,
19     pub clock_rate: u32,
20     pub channels: u16,
21     pub sdp_fmtp_line: String,
22     pub rtcp_feedback: Vec<RTCPFeedback>,
23 }
24 
25 /// RTCPFeedback signals the connection to use additional RTCP packet types.
26 /// https://draft.ortc.org/#dom-rtcrtcpfeedback
27 #[derive(Default, Debug, Clone)]
28 pub struct RTCPFeedback {
29     /// Type is the type of feedback.
30     /// see: https://draft.ortc.org/#dom-rtcrtcpfeedback
31     /// valid: ack, ccm, nack, goog-remb, transport-cc
32     pub typ: String,
33 
34     /// The parameter value depends on the type.
35     /// For example, type="nack" parameter="pli" will send Picture Loss Indicator packets.
36     pub parameter: String,
37 }
38