pub enum CodecType {
PCMU,
PCMA,
G722,
G729,
Opus,
TelephoneEvent,
}Variants§
Implementations§
Source§impl CodecType
impl CodecType
pub fn mime_type(&self) -> &str
pub fn rtpmap(&self) -> &str
pub fn fmtp(&self) -> Option<&str>
pub fn clock_rate(&self) -> u32
pub fn channels(&self) -> u16
pub fn payload_type(&self) -> u8
pub fn samplerate(&self) -> u32
pub fn is_audio(&self) -> bool
Sourcepub fn is_silence_frame(&self, payload: &[u8]) -> bool
pub fn is_silence_frame(&self, payload: &[u8]) -> bool
Whether payload says the sender went quiet: it is, or ends with,
the codec’s silence frame under discontinuous transmission (DTX).
A sender in DTX then sends nothing, or only more of these, until
speech resumes, so a jitter buffer should take the frames missing
after one as silence rather than loss, and not conceal them.
- Opus: a DTX packet, at most 2 bytes (as WebRTC tells them apart).
- G.729: a payload ending with an Annex B SID frame, 2 bytes after any 10-byte speech frames (RFC 3551 §4.5.6).
- Others have no DTX of their own:
false. Comfort noise sent in its own payload type (RFC 3389CN, static payload type 13) means the same, but isn’t a codec here: check for it by payload type.
pub fn is_dynamic(&self) -> bool
Trait Implementations§
impl Copy for CodecType
impl Eq for CodecType
Source§impl Ord for CodecType
impl Ord for CodecType
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for CodecType
impl PartialOrd for CodecType
impl StructuralPartialEq for CodecType
Auto Trait Implementations§
impl Freeze for CodecType
impl RefUnwindSafe for CodecType
impl Send for CodecType
impl Sync for CodecType
impl Unpin for CodecType
impl UnsafeUnpin for CodecType
impl UnwindSafe for CodecType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more