pub struct CodecProfile {
pub codec: String,
pub level: CodecLevel,
/* private fields */
}Expand description
An encoding profile combining codec name, level, and capability flags.
Fields§
§codec: StringCodec identifier (e.g. “h264”, “hevc”, “av1”).
level: CodecLevelConformance level.
Implementations§
Source§impl CodecProfile
impl CodecProfile
Sourcepub fn new(
codec: impl Into<String>,
level: CodecLevel,
max_bitrate_mbps: f64,
hw_encodable: bool,
) -> Self
pub fn new( codec: impl Into<String>, level: CodecLevel, max_bitrate_mbps: f64, hw_encodable: bool, ) -> Self
Creates a new codec profile.
Sourcepub fn with_10bit(self) -> Self
pub fn with_10bit(self) -> Self
Enables 10-bit colour support for this profile.
Sourcepub fn max_bitrate_mbps(&self) -> f64
pub fn max_bitrate_mbps(&self) -> f64
Returns the maximum bitrate in Megabits per second.
Sourcepub fn is_hardware_encodable(&self) -> bool
pub fn is_hardware_encodable(&self) -> bool
Returns true if this profile is typically hardware-encodable.
Sourcepub fn supports_10bit(&self) -> bool
pub fn supports_10bit(&self) -> bool
Returns true if this profile supports 10-bit depth.
Sourcepub fn max_pixels(&self) -> u64
pub fn max_pixels(&self) -> u64
Returns the maximum pixel count for this profile’s level.
Sourcepub fn supports_resolution(&self, width: u32, height: u32) -> bool
pub fn supports_resolution(&self, width: u32, height: u32) -> bool
Returns true if this profile can encode the given resolution.
Trait Implementations§
Source§impl Clone for CodecProfile
impl Clone for CodecProfile
Source§fn clone(&self) -> CodecProfile
fn clone(&self) -> CodecProfile
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 moreAuto Trait Implementations§
impl Freeze for CodecProfile
impl RefUnwindSafe for CodecProfile
impl Send for CodecProfile
impl Sync for CodecProfile
impl Unpin for CodecProfile
impl UnsafeUnpin for CodecProfile
impl UnwindSafe for CodecProfile
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