pub enum SurfaceEncoderPreference {
VulkanVideoH264,
VulkanVideoAV1,
H264Software,
H264Vaapi,
AV1Vaapi,
NvencH264,
NvencAV1,
AV1Software,
}Variants§
Implementations§
Source§impl SurfaceEncoderPreference
impl SurfaceEncoderPreference
pub fn parse(value: &str) -> Option<Self>
Sourcepub fn parse_list(value: &str) -> Result<Vec<Self>, String>
pub fn parse_list(value: &str) -> Result<Vec<Self>, String>
Parse a comma-separated list of encoder preferences.
Sourcepub fn defaults() -> Vec<Self>
pub fn defaults() -> Vec<Self>
Sensible default: hardware before software, NVENC preferred.
Override at runtime with BLIT_SURFACE_ENCODERS=h264-nvenc,h264-software
(comma-separated list).
Sourcepub fn supported_by_client(self, codec_support: u8) -> bool
pub fn supported_by_client(self, codec_support: u8) -> bool
Returns true if the given codec_support bitmask allows this encoder. A codec_support of 0 means “accept anything”.
Sourcepub fn supports_444_by_client(self, codec_support: u8) -> bool
pub fn supports_444_by_client(self, codec_support: u8) -> bool
Returns true if the client announced 4:4:4 chroma support for this encoder’s codec family. Legacy clients (codec_support == 0) are assumed to lack 4:4:4 support since the resulting Professional Profile bitstreams are not universally decodable.
Sourcepub fn max_dimensions(self) -> Option<(u16, u16)>
pub fn max_dimensions(self) -> Option<(u16, u16)>
Maximum surface dimensions the encoder can handle.
Returns None if there is no practical limit.
Sourcepub fn max_dimensions_for_list(prefs: &[Self]) -> Option<(u16, u16)>
pub fn max_dimensions_for_list(prefs: &[Self]) -> Option<(u16, u16)>
Tightest max dimensions across a list of preferences.
Sourcepub fn is_vulkan_video(self) -> bool
pub fn is_vulkan_video(self) -> bool
Whether this encoder runs in the compositor via Vulkan Video.
Sourcepub fn vulkan_codec(self) -> u8
pub fn vulkan_codec(self) -> u8
Vulkan Video codec byte: 0x01 = H.264, 0x02 = AV1.
Sourcepub fn codec_flag(self) -> u8
pub fn codec_flag(self) -> u8
Codec flag matching SURFACE_FRAME_CODEC_* constants.
Trait Implementations§
Source§impl Clone for SurfaceEncoderPreference
impl Clone for SurfaceEncoderPreference
Source§fn clone(&self) -> SurfaceEncoderPreference
fn clone(&self) -> SurfaceEncoderPreference
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SurfaceEncoderPreference
Source§impl Debug for SurfaceEncoderPreference
impl Debug for SurfaceEncoderPreference
impl Eq for SurfaceEncoderPreference
Source§impl Hash for SurfaceEncoderPreference
impl Hash for SurfaceEncoderPreference
Source§impl PartialEq for SurfaceEncoderPreference
impl PartialEq for SurfaceEncoderPreference
impl StructuralPartialEq for SurfaceEncoderPreference
Auto Trait Implementations§
impl Freeze for SurfaceEncoderPreference
impl RefUnwindSafe for SurfaceEncoderPreference
impl Send for SurfaceEncoderPreference
impl Sync for SurfaceEncoderPreference
impl Unpin for SurfaceEncoderPreference
impl UnsafeUnpin for SurfaceEncoderPreference
impl UnwindSafe for SurfaceEncoderPreference
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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