pub struct CodecMapping { /* private fields */ }Expand description
Maps container formats to supported video and audio codecs.
§Example
use oximedia_transcode::codec_mapping::{CodecMapping, CodecKind};
let mapping = CodecMapping::default();
let video_codecs = mapping.supported_codecs("mp4", CodecKind::Video);
assert!(video_codecs.contains(&"h264".to_string()));Implementations§
Source§impl CodecMapping
impl CodecMapping
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a CodecMapping populated with standard container/codec combinations.
Sourcepub fn supported_codecs(&self, container: &str, kind: CodecKind) -> Vec<CodecId> ⓘ
pub fn supported_codecs(&self, container: &str, kind: CodecKind) -> Vec<CodecId> ⓘ
Returns supported codecs for the given container and kind.
Returns an empty Vec if the container is unknown.
Sourcepub fn is_compatible(
&self,
container: &str,
codec: &str,
kind: CodecKind,
) -> bool
pub fn is_compatible( &self, container: &str, codec: &str, kind: CodecKind, ) -> bool
Returns true when codec is compatible with container for the given kind.
Sourcepub fn known_containers(&self) -> Vec<ContainerFormat> ⓘ
pub fn known_containers(&self) -> Vec<ContainerFormat> ⓘ
Returns all container formats known to this mapping.
Sourcepub fn find_compatible_containers(
&self,
video_codec: &str,
audio_codec: &str,
) -> Vec<ContainerFormat> ⓘ
pub fn find_compatible_containers( &self, video_codec: &str, audio_codec: &str, ) -> Vec<ContainerFormat> ⓘ
Finds containers that support both the given video and audio codecs.
Trait Implementations§
Source§impl Clone for CodecMapping
impl Clone for CodecMapping
Source§fn clone(&self) -> CodecMapping
fn clone(&self) -> CodecMapping
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodecMapping
impl Debug for CodecMapping
Auto Trait Implementations§
impl Freeze for CodecMapping
impl RefUnwindSafe for CodecMapping
impl Send for CodecMapping
impl Sync for CodecMapping
impl Unpin for CodecMapping
impl UnsafeUnpin for CodecMapping
impl UnwindSafe for CodecMapping
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more