styx (facade crate)
The end-user entry point that re-exports the layered stack (styx-core, styx-capture, styx-codec, optional backends) behind a single prelude. It adds a capture API, pipeline builder, metrics, probing helpers, and feature-gated preview support.
Documentation
Install
[]
= "0.1.0"
What it provides
styx::prelude: re-exports core/capture/codec preludes plus capture API (CaptureRequest,CaptureHandle,StyxConfig,start_capture,set_capture_tunables, etc.), pipeline types (MediaPipelineBuilder,MediaPipeline), metrics, and backend handles.probe_all: merge v4l2/libcamera probe results when enabled.BackendHandle/BackendKind,ProbedDevice,ProbedBackend: describe discovered devices and selected backends.capture_api: helpers for synthetic backends (make_netcam_device,make_file_device) and tunables.session:MediaPipelinefor capture→decode→hook→encode flows (sync-first; async helpers whenasyncis enabled).preview(featurepreview-window): simple RGBA/RGB preview window for examples.
Typical usage
Capture with a chosen backend/mode:
use *;
let devices = probe_all;
let device = devices.first.expect;
let handle = new
.backend_preferred // or V4l2/Libcamera when enabled
.start?;
match handle.recv
handle.stop;
Capture → decode pipeline with hooks and optional preview:
use Arc;
use *;
let device = /* virtual or probed device */;
let decoder = new;
let mut pipeline = new
.decoder
.frame_hook // works on FrameLease
.hook // DynamicImage hook (feature `hooks`)
.start?;
while let Data = pipeline.next
Global tunables for queues/pools/netcam backoff:
use *;
new
.capture_queue_depth
.capture_pool
.netcam_timeouts
.apply;
Examples
All examples live in crates/styx/examples and are runnable from this crate; see the workspace README for the full list and required feature flags.