The app's streams always offered H.264 at level 3.1: its peer
configuration is made before a share starts, and only voelinctl set the
real level. A 4K or high-frame-rate stream then declared far less in its
offer than in its SPS, which a viewer that sizes its decoder from the
offer may refuse.
Each layer's encoder now tells its sink what it makes
(`MediaSink::layer_format`: size, frame rate, bitrate, whether the
bitrate is automatic), when the sink is attached (from the size captured
so far, so a viewer that joins before the first frame is encoded is
covered), with the layer's first frame and on every change. The engine's
stream task offers new viewers the level of the largest layer (its
bitrate at `max_bitrate` if that is higher) in both profiles, and puts an
automatic bitrate into the layer as before; this one hook replaces
`auto_bitrate`.
Offering 6.0 broke the stream: str0m 0.23 knows no H.264 level above 5.2,
nor does libwebrtc (`H264Level` on its main branch), and a
`profile-level-id` they cannot parse matches nothing, so a viewer answered
without video (`m=video 0`). The offer is now capped at 5.2
(`h264::MAX_OFFER_LEVEL`); a stream that needs 6.x (4K above 60 fps, 8K)
is offered as 5.2 and keeps its real level in the SPS.
Tests: through two stream tasks, an encoder's 3840x2160@60 reaches the
next offer as 640c34 and 42e034 (and without the update it stays 3.1);
the largest layer counts, at its max bitrate; an automatic bitrate still
moves the layer once, not per frame.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>