use mediaframe::codec::AudioCodec as Foreign;
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct AudioCodec(Foreign);
impl AudioCodec {
#[inline]
#[must_use]
pub fn new(text: &str) -> Self {
Self(text.parse().unwrap_or_else(|never| match never {}))
}
#[inline]
#[must_use]
pub const fn get(&self) -> &Foreign {
&self.0
}
#[inline]
#[must_use]
pub fn into_inner(self) -> Foreign {
self.0
}
#[inline]
#[must_use]
pub fn as_str(&self) -> &str {
self.0.as_str()
}
#[inline]
#[must_use]
pub fn is_registered(&self) -> bool {
!self.0.is_other()
}
}
super::codec_citizen!(
AudioCodec,
mediaframe::codec::AudioCodec,
AudioCodecWire,
"AudioCodecFilter"
);
#[cfg(test)]
mod tests;