Expand description
Shared-memory frame ring consumed by the Selkies V4L2 interposer.
The ring is an anonymous memfd mapped once by this writer and once, read-only, by every
interposer client (it receives the fd over the control socket). Page 0 holds the header and the
per-slot control blocks; frame bytes start at DATA_OFFSET. Every constant and offset below is
mirrored by addons/v4l2-interposer/v4l2_interposer.c; the interposer refuses a connection whose
version differs.
Publishing is a single-writer seqlock per slot: the slot’s seq is bumped to odd, the frame is
written, seq is bumped to even, and only then does the header advertise the slot as the latest.
Readers copy the newest slot and retry if seq changed or was odd, so no cross-process lock exists
and a stalled reader never blocks the writer.
Structs§
- Ring
- Writer side of the ring. Not
Sync: one thread publishes. - Ring
Format - Geometry of the advertised device: a fixed-function camera with one format.
Constants§
- CONFIG_
SIZE - Byte size of the on-connect configuration struct (
webcam_config_t). - CTRL_
OFFSET - CTRL_
STRIDE - DATA_
OFFSET - MAX_
SLOTS - MIN_
SLOTS - SHM_
MAGIC - SHM_
VERSION - V4L2_
PIX_ FMT_ MJPEG - V4L2_
PIX_ FMT_ NV12 - V4L2_
PIX_ FMT_ YUV420 - V4L2 fourcc codes the ring can advertise.
- V4L2_
PIX_ FMT_ YUYV