use mediaframe::codec::SubtitleCodec as Foreign;
#[derive(Clone, PartialEq, Eq, Hash)]
pub struct SubtitleCodec(Foreign);
impl SubtitleCodec {
#[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!(
SubtitleCodec,
mediaframe::codec::SubtitleCodec,
SubtitleCodecWire,
"SubtitleCodecFilter"
);
#[cfg(test)]
mod tests;