pub struct CodecFactory;Expand description
Codec factory for creating codec instances
Implementations§
Source§impl CodecFactory
impl CodecFactory
Sourcepub fn create(config: CodecConfig) -> Result<Box<dyn AudioCodec>>
pub fn create(config: CodecConfig) -> Result<Box<dyn AudioCodec>>
Create a codec instance from configuration
§Errors
Returns an error when the configuration is invalid, the codec feature is disabled, or codec construction fails.
Sourcepub fn create_by_name(
name: &str,
config: CodecConfig,
) -> Result<Box<dyn AudioCodec>>
pub fn create_by_name( name: &str, config: CodecConfig, ) -> Result<Box<dyn AudioCodec>>
Create a codec by name
§Errors
Returns an error when name is unknown, its feature is disabled, or
the configuration is invalid.
Sourcepub fn create_by_payload_type(
payload_type: u8,
config: CodecConfig,
) -> Result<Box<dyn AudioCodec>>
pub fn create_by_payload_type( payload_type: u8, config: CodecConfig, ) -> Result<Box<dyn AudioCodec>>
Create a codec by RTP payload type
§Errors
Returns an error when the payload type is unknown, its codec feature is disabled, or the configuration is invalid.
Sourcepub fn supported_codecs() -> Vec<&'static str>
pub fn supported_codecs() -> Vec<&'static str>
Get all supported codec names
Sourcepub fn is_supported(name: &str) -> bool
pub fn is_supported(name: &str) -> bool
Check if a codec is supported
Auto Trait Implementations§
impl Freeze for CodecFactory
impl RefUnwindSafe for CodecFactory
impl Send for CodecFactory
impl Sync for CodecFactory
impl Unpin for CodecFactory
impl UnsafeUnpin for CodecFactory
impl UnwindSafe for CodecFactory
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