pub struct CodecProfileSelector { /* private fields */ }Expand description
Selects an appropriate codec profile based on resolution requirements.
Implementations§
Source§impl CodecProfileSelector
impl CodecProfileSelector
Sourcepub fn with_h264_defaults() -> Self
pub fn with_h264_defaults() -> Self
Creates a selector pre-loaded with common H.264 profiles.
Sourcepub fn with_hevc_defaults() -> Self
pub fn with_hevc_defaults() -> Self
Creates a selector pre-loaded with common HEVC profiles.
Sourcepub fn add(&mut self, profile: CodecProfile)
pub fn add(&mut self, profile: CodecProfile)
Adds a profile to the selector.
Sourcepub fn select_for_resolution(
&self,
width: u32,
height: u32,
) -> Option<&CodecProfile>
pub fn select_for_resolution( &self, width: u32, height: u32, ) -> Option<&CodecProfile>
Selects the lowest-level (most compatible) profile that supports the
given resolution. Returns None if no profile is sufficient.
Sourcepub fn all_for_resolution(&self, width: u32, height: u32) -> Vec<&CodecProfile>
pub fn all_for_resolution(&self, width: u32, height: u32) -> Vec<&CodecProfile>
Returns all profiles that support the given resolution.
Sourcepub fn profile_count(&self) -> usize
pub fn profile_count(&self) -> usize
Returns the number of profiles registered.
Trait Implementations§
Source§impl Debug for CodecProfileSelector
impl Debug for CodecProfileSelector
Source§impl Default for CodecProfileSelector
impl Default for CodecProfileSelector
Source§fn default() -> CodecProfileSelector
fn default() -> CodecProfileSelector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodecProfileSelector
impl RefUnwindSafe for CodecProfileSelector
impl Send for CodecProfileSelector
impl Sync for CodecProfileSelector
impl Unpin for CodecProfileSelector
impl UnsafeUnpin for CodecProfileSelector
impl UnwindSafe for CodecProfileSelector
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> 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