First part of the monitor stream socket series: a length-prefixed binary
protocol (version 1) intended to replace the per-monitor media FIFO text
framing. Pure encode/decode functions with no I/O.
- 24-byte fixed header (little-endian): length, version, type, stream,
flags, sequence, generation, pts_us
- Message types HELLO/MEDIA/KEYFRAME/STATS/BYE
- HELLO payload is a TLV list built from AVCodecParameters, carrying
codec id, extradata (SPS/PPS/VPS, AAC AudioSpecificConfig, AV1
sequence header), dimensions, frame rate, sample rate, channels,
profile and level; unknown tags are skipped by parsers
- STATS payload carries per-client sent/dropped counters
Tests: 8 new Catch2 test cases (header roundtrip and boundary/reject
cases, HELLO video/audio/no-extradata roundtrips, unknown-tag skip,
malformed-TLV rejection, STATS roundtrip). Full suite: 90/90 pass
locally via ctest with BUILD_TEST_SUITE=ON.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>