Architecture

Overview

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.

Layers

+---------------------------------------------------------------+ | public Rust API (Devices, Device, Event, types) | +---------------------------------------------------------------+ | per-model command table (selector, encode, decode triples) | +---------------------------------------------------------------+ | Transport trait { uvc_set(entity, sel, ..), | | uvc_get(req, entity, sel, ..) } | +---------------------------------------------------------------+ | Per-platform driver (Linux today: V4L2 + UVCIOC ioctls on | | /dev/videoN via uvcvideo; macOS = IOKit, Windows = WinUSB | | are planned in-tree, each as its own Transport impl) | +---------------------------------------------------------------+

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.

Control surfaces

The Meet 2 (and OBSBOT cameras generally) expose three UVC entities, all addressed through the same Transport API:

Standard UVC selectors are normative (the spec is the source); only the XU surface requires pcap audit-trail entries.

Threading

No tokio / async runtime. One long-lived thread per device is enough.

Where to expect change

What is intentionally out of scope (v1)