pub struct RtpRewriteRule {
pub match_payload_type: Option<u8>,
pub fixed_out_ssrc: Option<u32>,
pub ssrc_offset: u32,
pub out_payload_type: Option<u8>,
pub sdes_mid_extension_id: Option<u8>,
pub sdes_mid: Option<String>,
}Expand description
A single payload-type-scoped rewrite rule for the RTP rewrite bridge.
The bridge rewrites every forwarded packet using the most specific match:
a rule whose match_payload_type equals the packet’s payload type wins;
otherwise the single rule with match_payload_type: None acts as the
catch-all. Audio-only relays install one catch-all rule; video relays add
one rule per m-line payload type so audio, video and DTMF each get their own
destination SSRC / payload type (the legacy single-param bridge rewrote
every packet — audio AND video — to one SSRC/PT, which corrupted video).
Fields§
§match_payload_type: Option<u8>When Some(pt), only packets carrying this payload type are rewritten.
When None, this is the catch-all rule applied to any other packet.
fixed_out_ssrc: Option<u32>Fixed SSRC written on rewritten packets. Defaults to
src_ssrc + ssrc_offset when None.
ssrc_offset: u32SSRC offset applied when fixed_out_ssrc is None.
out_payload_type: Option<u8>Replacement payload type, or None to keep the original.
sdes_mid_extension_id: Option<u8>SDES-MID RTP header extension id (the extmap id negotiated for
urn:ietf:params:rtp-hdrext:sdes:mid). When set together with
Self::sdes_mid, packets rewritten by this rule get the MID
extension stamped so a WebRTC receiver (Chrome) can attribute them
to the negotiated track regardless of SSRC. Payload-type-scoped:
audio/DTMF rules carry the audio m-line’s mid, video rules the
video m-line’s mid. Only written when the bridge’s
RtpRewriteBridgeOptions::strip_extensions is false.
sdes_mid: Option<String>The destination leg’s MID value for this m-line (e.g. “0” for the audio m-line, “1” for video).
Implementations§
Source§impl RtpRewriteRule
impl RtpRewriteRule
Sourcepub fn catch_all(params: RtpRewriteBridgeParams) -> Self
pub fn catch_all(params: RtpRewriteBridgeParams) -> Self
The catch-all rule mirroring the legacy single-params behavior.
Sourcepub fn dtmf(src_pt: u8, dst_pt: u8, params: RtpRewriteBridgeParams) -> Self
pub fn dtmf(src_pt: u8, dst_pt: u8, params: RtpRewriteBridgeParams) -> Self
DTMF remap: rewrite a specific source PT to a destination PT while inheriting the same SSRC rewrite as the catch-all rule.
Sourcepub fn from_params(params: RtpRewriteBridgeParams) -> Vec<Self>
pub fn from_params(params: RtpRewriteBridgeParams) -> Vec<Self>
Convert the legacy params into the rule list they map to: a catch-all rule plus, when DTMF remapping is configured, a DTMF rule. This is the single place that interprets the legacy struct, keeping the rewrite path itself rule-table-only.
Trait Implementations§
Source§impl Clone for RtpRewriteRule
impl Clone for RtpRewriteRule
Source§fn clone(&self) -> RtpRewriteRule
fn clone(&self) -> RtpRewriteRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more