Expand description
Camera device enumeration (M-CAM.1 / AUT-255) — CLI-pipe pattern.
Spawns gst-device-monitor-1.0 Video/Source and parses its
human-readable text output into a Vec<CameraDevice>. Preserves
the project’s CLI-pipe-over-gstreamer-rs convention (CLAUDE.md:
“Upgrading to gstreamer-rs Rust bindings is a later chunk”).
The ticket spec offered three enumeration backends: gst CLI
subprocess (chosen), platform-native (`AVCaptureDevice` /
`IMFActivate` / `udev`), or the `gstreamer-rs` `DeviceMonitor`.
Option 1 minimises new surface area — no new Rust deps, no
per-OS code paths. The cost is parsing a loosely-specified text
output, mitigated by the fixture-driven parser tests below.Structs§
- Camera
Device - One attached camera device with a stable ID, a human-readable label, and a flag indicating whether the OS treats it as the default.
Functions§
- find_
by_ id - Locate the
CameraDevicewhose stable id matchesidby re-probing the OS vialist_cameras. Used bysuper::gstreamer_video::GstreamerVideoCapture::from_camerato resolve the picker’s camera id back to its OS-native source element on every recording start (M-CAM.4). ReturnsNonewhen the camera has been unplugged since enumeration. - list_
cameras - Enumerate every camera the OS exposes via
gst-device-monitor-1.0. - make_
device 🔒 - parse_
device_ monitor_ output - Pure-Rust parser for
gst-device-monitor-1.0 Video/Sourcetext output. Split out fromlist_camerasso the parser is testable against captured fixtures without needing gst installed. - stable_
id_ for - Derive a stable ID for a camera from its human-readable label using FNV-1a. Deterministic, dependency-free.