feat: xorg text overlays, font atlas generator, v4l2_view_cli

- tools/gen_font_atlas: Python/Pillow build tool — skyline packs DejaVu
  Sans glyphs 32-255 into a grayscale atlas, emits build/gen/font_atlas.h
  with pixel data and Font_Glyph[256] metrics table
- xorg: bitmap font atlas text overlay rendering (GL_R8 atlas texture,
  alpha-blended glyph quads, dark background rect per overlay)
- xorg: add xorg_viewer_set_overlay_text / clear_overlays API
- xorg: add xorg_viewer_handle_events for streaming use (events only,
  no redundant render)
- xorg_cli: show today's date as white text overlay
- v4l2_view_cli: new tool — V4L2 capture with format auto-selection
  (highest FPS then largest resolution), MJPEG/YUYV, measured FPS overlay
- docs: update README, planning, architecture to reflect current status

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-28 22:13:59 +00:00
parent 7fd79e6120
commit 611376dbc1
11 changed files with 1204 additions and 46 deletions

View File

@@ -20,6 +20,8 @@ video-setup/
serial/ - little-endian binary serialization primitives
transport/ - framed TCP stream, single-write send
protocol/ - typed write_*/read_* message functions
test_image/ - test pattern generator (colour bars, ramp, grid; YUV420/BGRA)
xorg/ - GLFW+OpenGL viewer sink; stub for headless builds
node/ - video node entry point and top-level integration (later)
include/ - public headers
dev/
@@ -27,6 +29,9 @@ video-setup/
web/ - development web UI (Node.js/Express); browser-side equivalent
of the CLI tools; depends on protocol being finalised
experiments/ - freeform experiments
tools/
gen_font_atlas/ - build-time bitmap font atlas generator (Python/Pillow);
outputs build/gen/font_atlas.h consumed by xorg module
tests/ - automated tests (later)
Makefile
architecture.md
@@ -43,22 +48,23 @@ Modules are listed in intended build order. Each depends only on modules above i
| # | Module | Status | Notes |
|---|---|---|---|
| 1 | `common` | done | Error types, base definitions — no dependencies |
| — | `config` | done | INI file loader with schema-driven defaults, typed getters, FLAGS type for bitmask values |
| 2 | `media_ctrl` | done | Media Controller API — device and topology enumeration, pad format config |
| 3 | `v4l2_ctrl` | done | V4L2 controls — enumerate, get, set camera parameters |
| 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` | done | Typed `write_*`/`read_*` functions for all message types; builds on serial + transport |
| 7 | `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 |
| 12 | `archive` | not started | Write frames to disk, control messages to binary log |
| 13 | `codec` | not started | Per-frame encode/decode — MJPEG (libjpeg-turbo), QOI, ZSTD-raw, VA-API H.264 intra; used by screen grab source and archive |
| 14 | `xorg` | not started | X11 screen geometry queries (XRandR), screen grab source (calls codec), frame viewer sink — see architecture.md |
| 8 | `test_image` | done | Test pattern generator — colour bars, luminance ramp, grid crosshatch; YUV420/BGRA output |
| 9 | `xorg` | done | GLFW+OpenGL viewer sink — YUV420/BGRA/MJPEG display, all scale/anchor modes, bitmap font atlas text overlays; XRandR queries and screen grab not yet implemented |
| 10 | `frame_alloc` | not started | Per-frame allocation with bookkeeping (byte budget, ref counting) |
| 11 | `relay` | not started | Input dispatch to output queues (low-latency and completeness modes) |
| 12 | `ingest` | not started | V4L2 capture loop — dequeue buffers, emit one encapsulated frame per buffer |
| 13 | `archive` | not started | Write frames to disk, control messages to binary log |
| 14 | `codec` | not started | Per-frame encode/decode — MJPEG (libjpeg-turbo), QOI, ZSTD-raw, VA-API H.264 intra; used by screen grab source and archive |
| 15 | `web node` | not started | Node.js/Express peer — speaks binary protocol on socket side, HTTP/WebSocket to browser; `protocol.mjs` mirrors C protocol module |
| — | `mjpeg_scan` | future | EOI marker scanner for misbehaving hardware that does not deliver clean per-buffer frames; not part of the primary pipeline |
| — | `config` | done | INI file loader with schema-driven defaults, typed getters, FLAGS type for bitmask values |
---
@@ -73,6 +79,9 @@ Each module gets a corresponding CLI driver that exercises its API and serves as
| `media_ctrl_cli` | `media_ctrl` | List media devices, show topology, configure pad formats |
| `v4l2_ctrl_cli` | `v4l2_ctrl` | List controls, get/set values — lightweight `v4l2-ctl` equivalent |
| `transport_cli` | `transport` | Send/receive framed messages, inspect headers |
| `test_image_cli` | `test_image` | Generate test patterns, write PPM for visual inspection |
| `xorg_cli` | `xorg` | Display test pattern in viewer window; exercises scale/anchor modes and text overlays |
| `v4l2_view_cli` | V4L2 + `xorg` | Live camera viewer — auto-selects highest-FPS format, FPS/format overlay; bypasses node system |
### Web UI (`dev/web/`)