Skip to main content

TrackDescription

Struct TrackDescription 

Source
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

Source

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).

Source

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).

Source

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).

Source

pub fn opus_audio(id: TrackId, channels: u8) -> Self

Opus audio track (RFC 7587: 48 kHz clock, stereo by default, PT 96).

Source

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).

Source

pub fn mp3_audio(id: TrackId) -> Self

MPEG-1/2 Audio (MP3) track: 90 kHz clock, static payload type 14.

Source

pub fn g726_16_audio(id: TrackId) -> Self

Source

pub fn g726_24_audio(id: TrackId) -> Self

Source

pub fn g726_32_audio(id: TrackId) -> Self

Source

pub fn g726_40_audio(id: TrackId) -> Self

Source

pub fn av1_video(id: TrackId, width: u32, height: u32) -> Self

AV1 video track (90 kHz clock, dynamic payload type).

Source

pub fn jpeg_video(id: TrackId, width: u32, height: u32) -> Self

Motion JPEG video track (90 kHz clock, dynamic payload type).

Source

pub fn h263_video(id: TrackId, width: u32, height: u32) -> Self

H.263 video track (H263-1998, 90 kHz clock).

Source

pub fn mpeg4_video(id: TrackId, width: u32, height: u32) -> Self

MPEG-4 Part 2 Visual track (MP4V-ES, 90 kHz clock).

Source

pub fn pcmu_audio(id: TrackId, sample_rate: u32, channels: u8) -> Self

G.711 μ-law audio track (8 kHz, 1 channel; no fmtp needed).

Trait Implementations§

Source§

impl Clone for TrackDescription

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for TrackDescription

Source§

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

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

impl Eq for TrackDescription

Source§

impl PartialEq for TrackDescription

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TrackDescription

Auto Trait Implementations§

§

impl Forget for TrackDescription

§

impl Freeze for TrackDescription
where *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for TrackDescription

§

impl RefUnwindSafe for TrackDescription

§

impl Send for TrackDescription
where Arc<str>: Send, RawVecInner: Send,

§

impl Sync for TrackDescription
where Arc<str>: Sync, RawVecInner: Sync,

§

impl Unpin for TrackDescription
where Arc<str>: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for TrackDescription
where *const ArcInner<str> is !null: UnsafeUnpin, PhantomData<ArcInner<str>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin,

§

impl UnwindSafe for TrackDescription
where Arc<str>: UnwindSafe, RawVecInner: UnwindSafe,

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<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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more