Skip to main content

Module camera

Module camera 

Source

Modules§

linux 🔒

Constants§

POLL_INTERVAL 🔒

Functions§

app_is_active 🔒
The Windows webcam-in-use rule: an app’s LastUsedTimeStop of 0 means it is currently streaming (a non-zero value is the timestamp it stopped). Extracted so the rule itself is testable without a registry; the registry walk in windows::any_active_app feeds it. Un-gated so it’s tested everywhere; only the Windows walk calls it in non-test builds.
classify_camera_line 🔒
Classify one line of macOS log stream output: Some(true) when the camera turned on, Some(false) when it turned off, None for an unrelated line. Start wins if a single line somehow carries both markers, matching the original if/else if ordering. Kept un-gated so the start/stop contract is unit-tested on every OS — only the macOS log-stream reader calls it in non-test builds.
classify_camera_set 🔒
Decide whether Control Center’s published camera set is empty. rest is everything after "cameras changed to ". Some(false) for an empty collection — [] (earlier macOS) or [:] (the empty-dictionary form macOS 26 emits on release, #158) — and Some(true) for a non-empty one. Returns None when the payload is redacted (<private>) or otherwise has no bracketed collection — we can’t tell the state, so we leave it unchanged rather than guess.
spawn_monitor