pub struct CaptureConfig {
pub mode: ModeId,
pub interval: Option<Interval>,
pub controls: Vec<(ControlId, ControlValue)>,
}Expand description
User-selected configuration validated against a descriptor.
§Example
use styx_capture::prelude::*;
let res = Resolution::new(320, 240).unwrap();
let format = MediaFormat::new(FourCc::new(*b"RG24"), res, ColorSpace::Srgb);
let mode = Mode {
id: ModeId { format, interval: None },
format,
intervals: smallvec::smallvec![],
interval_stepwise: None,
};
let descriptor = CaptureDescriptor { modes: vec![mode.clone()], controls: Vec::new() };
let cfg = CaptureConfig { mode: mode.id.clone(), interval: None, controls: vec![] };
assert!(cfg.validate(&descriptor).is_ok());Fields§
§mode: ModeIdSelected mode.
interval: Option<Interval>Optional interval override.
controls: Vec<(ControlId, ControlValue)>Control assignments.
Implementations§
Source§impl CaptureConfig
impl CaptureConfig
Trait Implementations§
Source§impl Clone for CaptureConfig
impl Clone for CaptureConfig
Source§fn clone(&self) -> CaptureConfig
fn clone(&self) -> CaptureConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CaptureConfig
impl RefUnwindSafe for CaptureConfig
impl Send for CaptureConfig
impl Sync for CaptureConfig
impl Unpin for CaptureConfig
impl UnwindSafe for CaptureConfig
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