Add protocol module, video-node binary, query/web CLI tools

- Protocol module: framed binary encoding for control requests/responses
  (ENUM_DEVICES, ENUM_CONTROLS, GET/SET_CONTROL, STREAM_OPEN/CLOSE)
- video-node: scans /dev/media* and /dev/video*, serves V4L2 device
  topology and controls over TCP; uses UDP discovery for peer announce
- query_cli: auto-discovers a node, queries devices and controls
- protocol_cli: low-level protocol frame decoder for debugging
- dev/web: Express 5 ESM web inspector — live SSE discovery picker,
  REST bridge to video-node, controls UI with sliders/selects/checkboxes
- Makefile: sequential module builds before cli/node to fix make -j races
- common.mk: add DEPFLAGS (-MMD -MP) for automatic header dependencies
- All module Makefiles: split compile/link, generate .d dependency files
- discovery: replace 100ms poll loop with pthread_cond_timedwait;
  respond to all announcements (not just new peers) for instant re-discovery
- ENUM_DEVICES response: carry device_caps (V4L2_CAP_*) per video node
  so clients can distinguish capture nodes from metadata nodes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-27 01:04:56 +00:00
parent 34386b635e
commit 62c25247ef
32 changed files with 3998 additions and 81 deletions

View File

@@ -48,7 +48,8 @@ Modules are listed in intended build order. Each depends only on modules above i
| 4 | `serial` | done | `put`/`get` primitives for little-endian binary serialization into byte buffers |
| 5 | `transport` | done | Encapsulated transport — frame header, TCP stream abstraction, single-write send |
| 6 | `discovery` | done | UDP multicast announcements, peer table, found/lost callbacks |
| 8 | `protocol` | not started | Typed `write_*`/`read_*` functions for all message types; builds on serial + transport |
| 8 | `protocol` | done | Typed `write_*`/`read_*` functions for all message types; builds on serial + transport |
| — | `node` | done | Video node binary — config, discovery, transport server, V4L2/media control request handlers |
| 9 | `frame_alloc` | not started | Per-frame allocation with bookkeeping (byte budget, ref counting) |
| 10 | `relay` | not started | Input dispatch to output queues (low-latency and completeness modes) |
| 11 | `ingest` | not started | V4L2 capture loop — dequeue buffers, emit one encapsulated frame per buffer |