pub enum SurfaceQuality {
Low,
Medium,
High,
Ultra,
Custom {
quantizer: u8,
},
}Expand description
Video quality preset. Higher quality uses more CPU / bandwidth.
- Low: speed 10, quantizer 180 — minimal CPU, visibly lossy
- Medium (default): speed 10, quantizer 120 — good balance
- High: speed 8, quantizer 80 — sharp, noticeable CPU use
- Ultra: speed 6, quantizer 1 — near-lossless, heavy CPU
- Custom: caller-specified AV1 quantizer (10–255)
Set via BLIT_SURFACE_QUALITY=low|medium|high|ultra.
Variants§
Low
Medium
High
Ultra
Custom
Caller-specified AV1 quantizer (10–255). H.264 QP, encoder speed, and software-encoder bitrate are derived proportionally.
Implementations§
Source§impl SurfaceQuality
impl SurfaceQuality
pub fn parse(value: &str) -> Option<Self>
Sourcepub fn from_wire(value: u8) -> Option<Self>
pub fn from_wire(value: u8) -> Option<Self>
Decode from the wire quality byte in C2S_SURFACE_SUBSCRIBE.
- 0 →
None(server default) - 1–4 → named presets
- 10–255 →
Custom { quantizer: value } - 5–9 → reserved, treated as server default
Sourcepub fn h264_qp(self) -> u8
pub fn h264_qp(self) -> u8
H.264 QP for constant-quality mode (0 = best, 51 = worst). Used by NVENC H.264 and VA-API H.264.
Sourcepub fn nvenc_av1_qp(self) -> u32
pub fn nvenc_av1_qp(self) -> u32
NVENC AV1 QP for constant-quality mode (0 = best, 255 = worst).
Same scale as av1_quantizer / VA-API base_qindex.
Sourcepub fn av1_qp_for_vulkan(self) -> u8
pub fn av1_qp_for_vulkan(self) -> u8
AV1 QP for Vulkan Video encode (0 = best, 255 = worst). Same base_qindex scale as VA-API / NVENC.
Trait Implementations§
Source§impl Clone for SurfaceQuality
impl Clone for SurfaceQuality
Source§fn clone(&self) -> SurfaceQuality
fn clone(&self) -> SurfaceQuality
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SurfaceQuality
Source§impl Debug for SurfaceQuality
impl Debug for SurfaceQuality
Source§impl Default for SurfaceQuality
impl Default for SurfaceQuality
Source§fn default() -> SurfaceQuality
fn default() -> SurfaceQuality
Returns the “default value” for a type. Read more
impl Eq for SurfaceQuality
Source§impl PartialEq for SurfaceQuality
impl PartialEq for SurfaceQuality
impl StructuralPartialEq for SurfaceQuality
Auto Trait Implementations§
impl Freeze for SurfaceQuality
impl RefUnwindSafe for SurfaceQuality
impl Send for SurfaceQuality
impl Sync for SurfaceQuality
impl Unpin for SurfaceQuality
impl UnsafeUnpin for SurfaceQuality
impl UnwindSafe for SurfaceQuality
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> 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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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>
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 moreSource§impl<T> ResetDiscriminant<T> for Twhere
T: Copy,
impl<T> ResetDiscriminant<T> for Twhere
T: Copy,
Source§fn discriminant(&self) -> T
fn discriminant(&self) -> T
Value based on which equality for the reset will be determined.