Expand description
Contract F — the vision-tap wire format.
The frozen seam between the video pipeline (the writer, ados-video) and the
vision engine (the reader, ados-vision). A tap carries decoded rawvideo
frames from the encode pipeline to the engine over a Unix socket: the engine
connects as a client, the writer serves the socket and streams
[header][pixels] per frame.
Framing (v2): a 24-byte little-endian header, then byte_len raw pixel
bytes:
magic:u32=0x41445654 ("ADVT") | format:u8 | _pad:u8 | width:u16 | height:u16 | _pad:u16 | byte_len:u32 | ts_mono_ns:u64ts_mono_ns is host CLOCK_MONOTONIC ns stamped by the writer at frame arrival.
Self-describing so a consumer can size a ring without a side channel. This
module is the single definition both sides build against — freeze it here,
change both sides in the same version bump (the same frozen-wire-contract
discipline the mavlink, state, and plugin sockets already follow, now
extended to the vision seam).
Structs§
- TapHeader
- A decoded tap frame header.
Enums§
- TapHeader
Error - A malformed tap header.
Constants§
- TAP_
CONTRACT_ VERSION - The tap wire-contract version. Bump on any framing change; both the writer and the reader must move together.
- TAP_
HEADER_ LEN - Fixed header length in bytes.
- TAP_
MAGIC - Header magic — ASCII “ADVT”, little-endian.
- TAP_
MAX_ FRAME - Cap a single tapped frame so a corrupt header cannot drive an unbounded allocation. 4K RGB24 is ~25 MiB; 64 MiB is a generous ceiling.
Functions§
- decode_
tap_ header - Decode a tap frame header.
- encode_
tap_ header - Encode the tap frame header. The writer prepends this to each frame’s pixels.
- format_
from_ tag - The
FrameFormatfor a wire tag, orNonefor an unknown tag. - format_
tag - The pixel-format wire tag for a
FrameFormat. - write_
tap_ frame - Write one
[header][pixels]tap frame tow. The shared writer the video pipeline shim and any producer use so the framing matches the reader exactly.