libobsbot is a Rust workspace with two member crates:
libobsbot-core (pure Rust library) and
libobsbot-ffi (C ABI cdylib + staticlib generated from
libobsbot-core). The core crate is the only crate that
touches USB.
The narrowest layer - Transport - is the
boundary that mocks plug into for encoding tests. Every selector and
byte-layout constant in the per-model command table must be justified by
a committed pcap; see the
sourcing rule.
The Meet 2 (and OBSBOT cameras generally) expose three UVC entities,
all addressed through the same Transport API:
{9a1e7291-6843-4683-6d92-39bc7906ee49}) for
proprietary behaviors (mediaMode, HDR, FOV preset, face AE/focus,
AI mode, status). All vendor-specific bytes live here.Standard UVC selectors are normative (the spec is the source); only the XU surface requires pcap audit-trail entries.
std::thread spawned
by Devices::new, pumping events into a
crossbeam_channel.Device owns one status-poller thread
that issues uvc_get for brightness, contrast,
saturation (Processing Unit) and pan/tilt/zoom (Camera Terminal)
every 2.5 s (slow mode) or 25 ms (fast mode), pushing
Event::Status snapshots into the same channel.
Firmware/serial ride the XU RPC channel and are exposed via
dedicated methods rather than the periodic sample.GET_CUR are also synchronous.No tokio / async runtime. One long-lived thread per
device is enough.
src/devices/meet2.rs grows whenever a new XU
control is captured and decoded. The CRC, MAC handshake, and
mode-register status blob are already in place; remaining
additions are mostly per-method captures of advanced controls
(MAE-ISO, mirror / flip, firmware-upgrade trigger, ...).src/transport/usb.rs (Linux) and
src/transport/macos.rs (macOS) ship today. A
Windows (WinUSB) transport is planned. See
macos-port-plan.md
for the macOS design notes.src/discovery.rs polls every 2 s for hot-plug
changes. Switching to push-based notification
(libudev on Linux,
IOServiceAddMatchingNotification on macOS) is
future work.Transport trait will grow.