styx-capture
Capture descriptors/config validation and the CaptureSource trait for zero-copy frame producers. Includes helpers for building frames from buffer pools and a simple virtual backend for tests.
Documentation
Install
[]
= "0.1.0"
Key types
Mode/ModeId: advertised capture modes (FourCc + resolution + intervals).CaptureDescriptor: modes + control metadata for a device/source.CaptureConfig: user-selected mode/interval/controls with validation.CaptureSource: trait yieldingFrameLeaseframes (sync-first).
Building descriptors
modes_from_formats converts a list of MediaFormat values into modes, or build them manually:
use *;
let mode = Mode ;
let descriptor = CaptureDescriptor ;
let cfg = CaptureConfig ;
cfg.validate.unwrap;
Virtual capture
virtual_backend::VirtualCapture emits patterned frames from a pool:
use *;
let pool = with_limits;
let mode = modes_from_formats.clone;
let cap = new;
let frame = cap.next_frame.unwrap;
assert_eq!;
Frame helpers
build_frame_from_pool constructs a single-plane frame with the correct layout/stride for a given FourCc/resolution, returning a pooled FrameLease ready for downstream codecs or pipelines.