pub struct CodecCaps {
pub codec_id: String,
pub max_width: u32,
pub max_height: u32,
pub hw_accels: Vec<HwAccelType>,
pub b_frames: bool,
pub lossless: bool,
}Expand description
Capabilities record for a single codec.
Fields§
§codec_id: StringCodec identifier string (e.g. "h264", "av1").
max_width: u32Maximum supported width in pixels.
max_height: u32Maximum supported height in pixels.
hw_accels: Vec<HwAccelType>Supported hardware accelerators.
b_frames: boolWhether the codec supports B-frames.
lossless: boolWhether the codec supports lossless mode.
Implementations§
Source§impl CodecCaps
impl CodecCaps
Sourcepub fn with_max_resolution(self, w: u32, h: u32) -> Self
pub fn with_max_resolution(self, w: u32, h: u32) -> Self
Builder: set maximum resolution.
Sourcepub fn with_hw_accel(self, accel: HwAccelType) -> Self
pub fn with_hw_accel(self, accel: HwAccelType) -> Self
Builder: add a hardware accelerator.
Sourcepub fn with_b_frames(self) -> Self
pub fn with_b_frames(self) -> Self
Builder: enable B-frame support.
Sourcepub fn with_lossless(self) -> Self
pub fn with_lossless(self) -> Self
Builder: enable lossless mode.
Sourcepub fn supports_hw_accel(&self, accel: HwAccelType) -> bool
pub fn supports_hw_accel(&self, accel: HwAccelType) -> bool
Returns true if this codec supports the given hardware accelerator.
Sourcepub fn supports_resolution(&self, width: u32, height: u32) -> bool
pub fn supports_resolution(&self, width: u32, height: u32) -> bool
Returns true if the codec can encode frames of the given dimensions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodecCaps
impl RefUnwindSafe for CodecCaps
impl Send for CodecCaps
impl Sync for CodecCaps
impl Unpin for CodecCaps
impl UnsafeUnpin for CodecCaps
impl UnwindSafe for CodecCaps
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> 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