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: boolHardware-accelerated implementation (VAAPI/NVENC/QSV/VideoToolbox/…).
implementation: StringShort 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: i32Lower 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
impl CodecCapabilities
Sourcepub fn audio(implementation: impl Into<String>) -> Self
pub fn audio(implementation: impl Into<String>) -> Self
Construct a software audio decoder/encoder capability set with sensible defaults — adjust fields after creation.
pub fn video(implementation: impl Into<String>) -> Self
Sourcepub fn flag_string(&self) -> String
pub fn flag_string(&self) -> String
6-character ffmpeg-style flag string. Useful for oxideav list-style
output.
pub fn with_decode(self) -> Self
pub fn with_encode(self) -> Self
pub fn with_intra_only(self, v: bool) -> Self
pub fn with_lossy(self, v: bool) -> Self
pub fn with_lossless(self, v: bool) -> Self
pub fn with_hardware(self, v: bool) -> Self
pub fn with_priority(self, p: i32) -> Self
pub fn with_max_size(self, w: u32, h: u32) -> Self
pub fn with_max_bitrate(self, br: u64) -> Self
pub fn with_max_sample_rate(self, sr: u32) -> Self
pub fn with_max_channels(self, ch: u16) -> Self
Sourcepub fn with_pixel_format(self, fmt: PixelFormat) -> Self
pub fn with_pixel_format(self, fmt: PixelFormat) -> Self
Add one accepted pixel format. Appends — call multiple times to list several.
Sourcepub fn with_pixel_formats(self, fmts: Vec<PixelFormat>) -> Self
pub fn with_pixel_formats(self, fmts: Vec<PixelFormat>) -> Self
Replace the accepted pixel-format set wholesale.
Trait Implementations§
Source§impl Clone for CodecCapabilities
impl Clone for CodecCapabilities
Source§fn clone(&self) -> CodecCapabilities
fn clone(&self) -> CodecCapabilities
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more