pub enum G711Codec {
Pcmu,
Pcma,
}Expand description
Codec selection for a session. The wire payload-type number
(0/8) is the canonical identifier; this enum is the typed
version we pass around in code.
Variants§
Pcmu
μ-law (G.711U) — North America / Japan default, RTP payload type 0.
Pcma
A-law (G.711A) — Europe / rest-of-world default, RTP payload type 8.
Implementations§
Source§impl G711Codec
impl G711Codec
Sourcepub fn payload_type(self) -> u8
pub fn payload_type(self) -> u8
The static RTP payload-type number for this codec — 0 for PCMU,
8 for PCMA (RFC 3551 §6).
Sourcepub fn from_payload_type(pt: u8) -> Option<Self>
pub fn from_payload_type(pt: u8) -> Option<Self>
Resolve from a SIP/RTP payload type number. Returns None for
any non-G.711 payload type — the caller decides whether to fall
through (e.g. accept anyway, ask for re-INVITE, reject).
Trait Implementations§
impl Copy for G711Codec
impl Eq for G711Codec
impl StructuralPartialEq for G711Codec
Auto Trait Implementations§
impl Freeze for G711Codec
impl RefUnwindSafe for G711Codec
impl Send for G711Codec
impl Sync for G711Codec
impl Unpin for G711Codec
impl UnsafeUnpin for G711Codec
impl UnwindSafe for G711Codec
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