Skip to main content

CodecCapabilities

Struct CodecCapabilities 

Source
pub struct CodecCapabilities {
Show 15 fields pub decode: bool, pub encode: bool, pub media_type: MediaType, pub intra_only: bool, pub lossy: bool, pub lossless: bool, pub hardware_accelerated: bool, pub implementation: String, pub max_width: Option<u32>, pub max_height: Option<u32>, pub max_bitrate: Option<u64>, pub max_sample_rate: Option<u32>, pub max_channels: Option<u16>, pub priority: i32, pub accepted_pixel_formats: Vec<PixelFormat>,
}
Expand description

What an implementation can do plus how it ranks vs alternatives.

Fields§

§decode: bool§encode: bool§media_type: MediaType§intra_only: bool§lossy: bool§lossless: bool§hardware_accelerated: bool

Hardware-accelerated implementation (VAAPI/NVENC/QSV/VideoToolbox/…).

§implementation: String

Short identifier for this implementation, e.g. “flac_sw”, “h264_qsv”.

§max_width: Option<u32>

Restrictions — None means “no constraint”.

§max_height: Option<u32>§max_bitrate: Option<u64>§max_sample_rate: Option<u32>§max_channels: Option<u16>§priority: i32

Lower numbers are preferred. HW impls should be ~10, SW impls ~100.

§accepted_pixel_formats: Vec<PixelFormat>

Pixel formats this implementation accepts (video only). An empty Vec means “any format” — resolution won’t filter on it. When populated, the registry can skip impls whose accepted set does not include the format requested by the caller.

Implementations§

Source§

impl CodecCapabilities

Source

pub fn audio(implementation: impl Into<String>) -> Self

Construct a software audio decoder/encoder capability set with sensible defaults — adjust fields after creation.

Source

pub fn video(implementation: impl Into<String>) -> Self

Source

pub fn flag_string(&self) -> String

6-character ffmpeg-style flag string. Useful for oxideav list-style output.

Source

pub fn with_decode(self) -> Self

Source

pub fn with_encode(self) -> Self

Source

pub fn with_intra_only(self, v: bool) -> Self

Source

pub fn with_lossy(self, v: bool) -> Self

Source

pub fn with_lossless(self, v: bool) -> Self

Source

pub fn with_hardware(self, v: bool) -> Self

Source

pub fn with_priority(self, p: i32) -> Self

Source

pub fn with_max_size(self, w: u32, h: u32) -> Self

Source

pub fn with_max_bitrate(self, br: u64) -> Self

Source

pub fn with_max_sample_rate(self, sr: u32) -> Self

Source

pub fn with_max_channels(self, ch: u16) -> Self

Source

pub fn with_pixel_format(self, fmt: PixelFormat) -> Self

Add one accepted pixel format. Appends — call multiple times to list several.

Source

pub fn with_pixel_formats(self, fmts: Vec<PixelFormat>) -> Self

Replace the accepted pixel-format set wholesale.

Trait Implementations§

Source§

impl Clone for CodecCapabilities

Source§

fn clone(&self) -> CodecCapabilities

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CodecCapabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CodecCapabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.