pub struct TrackDescription {Show 17 fields
pub id: TrackId,
pub kind: MediaKind,
pub codec: Codec,
pub clock_rate: u32,
pub channels: Option<u8>,
pub payload_type: u8,
pub fmtp: Option<Arc<str>>,
pub control: Arc<str>,
pub width: Option<u32>,
pub height: Option<u32>,
pub frame_rate: Option<(u32, u32)>,
pub direction: Option<SdpDirection>,
pub ptime: Option<u32>,
pub rtcp: Option<RtcpAddress>,
pub bandwidth_as: Option<u32>,
pub rtx: Option<RtxConfig>,
pub crypto: Option<SdpCrypto>,
}Fields§
§id: TrackId§kind: MediaKind§codec: Codec§clock_rate: u32§channels: Option<u8>§payload_type: u8§fmtp: Option<Arc<str>>§control: Arc<str>§width: Option<u32>Video width in pixels (if known).
height: Option<u32>Video height in pixels (if known).
frame_rate: Option<(u32, u32)>Video frame rate as (numerator, denominator) (if known).
direction: Option<SdpDirection>SDP media direction; None means unspecified.
ptime: Option<u32>SDP a=ptime packetization interval in milliseconds.
rtcp: Option<RtcpAddress>SDP a=rtcp RTCP port/address override.
bandwidth_as: Option<u32>SDP b=AS bandwidth in kbit/s.
rtx: Option<RtxConfig>RFC 4588 RTX mapping when the SDP advertised a retransmission stream.
crypto: Option<SdpCrypto>SRTP crypto parameters from SDP a=crypto: attribute.
Implementations§
Source§impl TrackDescription
impl TrackDescription
Sourcepub fn h264_video(
id: TrackId,
sps: &[u8],
pps: &[u8],
width: u32,
height: u32,
frame_rate: u32,
) -> Self
pub fn h264_video( id: TrackId, sps: &[u8], pps: &[u8], width: u32, height: u32, frame_rate: u32, ) -> Self
H.264 video track from encoder parameter sets.
sps/pps are the NAL bodies without start codes (extract them
with bitstream::h264_parameter_sets from an Annex-B IDR).
sps/pps may be empty for raw single-NAL setups, in which case
the fmtp is a plain packetization-mode=1 (the mount auto-injects
sprop-parameter-sets once a keyframe with parameter sets arrives).
Sourcepub fn h265_video(
id: TrackId,
vps: &[u8],
sps: &[u8],
pps: &[u8],
width: u32,
height: u32,
frame_rate: u32,
) -> Self
pub fn h265_video( id: TrackId, vps: &[u8], sps: &[u8], pps: &[u8], width: u32, height: u32, frame_rate: u32, ) -> Self
H.265 video track from encoder parameter sets (VPS/SPS/PPS NAL bodies without start codes).
Sourcepub fn aac_audio(id: TrackId, sample_rate: u32, channels: u8) -> Self
pub fn aac_audio(id: TrackId, sample_rate: u32, channels: u8) -> Self
AAC-LC audio track (MPEG4-GENERIC, RFC 3640 fmtp with an
auto-generated config= AudioSpecificConfig).
Sourcepub fn opus_audio(id: TrackId, channels: u8) -> Self
pub fn opus_audio(id: TrackId, channels: u8) -> Self
Opus audio track (RFC 7587: 48 kHz clock, stereo by default, PT 96).
Sourcepub fn pcma_audio(id: TrackId, sample_rate: u32, channels: u8) -> Self
pub fn pcma_audio(id: TrackId, sample_rate: u32, channels: u8) -> Self
G.711 A-law audio track (8 kHz, 1 channel; no fmtp needed).
Sourcepub fn mp3_audio(id: TrackId) -> Self
pub fn mp3_audio(id: TrackId) -> Self
MPEG-1/2 Audio (MP3) track: 90 kHz clock, static payload type 14.
pub fn g726_16_audio(id: TrackId) -> Self
pub fn g726_24_audio(id: TrackId) -> Self
pub fn g726_32_audio(id: TrackId) -> Self
pub fn g726_40_audio(id: TrackId) -> Self
Sourcepub fn av1_video(id: TrackId, width: u32, height: u32) -> Self
pub fn av1_video(id: TrackId, width: u32, height: u32) -> Self
AV1 video track (90 kHz clock, dynamic payload type).
Sourcepub fn jpeg_video(id: TrackId, width: u32, height: u32) -> Self
pub fn jpeg_video(id: TrackId, width: u32, height: u32) -> Self
Motion JPEG video track (90 kHz clock, dynamic payload type).
Sourcepub fn h263_video(id: TrackId, width: u32, height: u32) -> Self
pub fn h263_video(id: TrackId, width: u32, height: u32) -> Self
H.263 video track (H263-1998, 90 kHz clock).
Sourcepub fn mpeg4_video(id: TrackId, width: u32, height: u32) -> Self
pub fn mpeg4_video(id: TrackId, width: u32, height: u32) -> Self
MPEG-4 Part 2 Visual track (MP4V-ES, 90 kHz clock).
Sourcepub fn pcmu_audio(id: TrackId, sample_rate: u32, channels: u8) -> Self
pub fn pcmu_audio(id: TrackId, sample_rate: u32, channels: u8) -> Self
G.711 μ-law audio track (8 kHz, 1 channel; no fmtp needed).