pub struct CodecPolicyBuilder { /* private fields */ }Expand description
Builder for codec selection policy.
§Example
use styx_codec::CodecPolicy;
use styx_core::prelude::FourCc;
let policy = CodecPolicy::builder(FourCc::new(*b"MJPG"))
.ordered_impls(["ffmpeg", "jpeg-decoder"])
.priority("ffmpeg", 0)
.build();Implementations§
Source§impl CodecPolicyBuilder
impl CodecPolicyBuilder
Sourcepub fn prefer_hardware(self, prefer: bool) -> Self
pub fn prefer_hardware(self, prefer: bool) -> Self
Disable or enable hardware bias.
Sourcepub fn ordered_impls<I, S>(self, impls: I) -> Self
pub fn ordered_impls<I, S>(self, impls: I) -> Self
Explicit ordered implementations to try first.
Sourcepub fn priority<S: Into<String>>(self, impl_name: S, priority: i32) -> Self
pub fn priority<S: Into<String>>(self, impl_name: S, priority: i32) -> Self
Set an integer priority for an impl name (lower wins).
pub fn build(self) -> CodecPolicy
Auto Trait Implementations§
impl Freeze for CodecPolicyBuilder
impl RefUnwindSafe for CodecPolicyBuilder
impl Send for CodecPolicyBuilder
impl Sync for CodecPolicyBuilder
impl Unpin for CodecPolicyBuilder
impl UnwindSafe for CodecPolicyBuilder
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> 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