datarhei-dragonfork-core/core/webrtc
ZGaetano a2e0a8c083
Some checks failed
ci / race tests (push) Blocked by required conditions
ci / WebRTC smoke (5-viewer fanout) (push) Blocked by required conditions
ci / WebRTC latency p95 gate (push) Blocked by required conditions
ci / vet + build (push) Has been cancelled
feat(webrtc): add H.264 keyframe burst cache (issue #17)
Introduces keyFrameCache — a bounded ring buffer that retains all RTP
packets from the most recent H.264 IDR NAL unit until the packet just
before the next one. New WHEP subscribers receive this burst immediately
on Subscribe(), cutting first-frame latency from up to one IDR interval
(typically ~2 s at GOP=60/30fps) to nearly zero.

Design notes:
- Detection covers single-NAL (type 5) and FU-A start (type 28, start
  bit set, inner type 5). STAP-A IDR leading is not handled — FFmpeg
  never uses STAP-A for IDR slices in practice.
- Bounded at 512 packets / 2 MiB per source to cap memory per stream.
- push() is called only from the single-goroutine readLoop; the lock
  it holds is tiny and brief.
- snapshot() returns a shallow copy; *rtp.Packet values are immutable
  after being placed in the cache so sharing is safe.
2026-05-09 19:03:33 -04:00
..
config.go feat(webrtc): add Config with defaults and validation 2026-04-17 08:44:30 -04:00
config_test.go feat(webrtc): add Config with defaults and validation 2026-04-17 08:44:30 -04:00
doc.go feat(webrtc): add package skeleton and typed errors 2026-04-17 08:43:57 -04:00
errors.go feat(webrtc): add package skeleton and typed errors 2026-04-17 08:43:57 -04:00
forward.go feat(webrtc): add app/webrtc subsystem + lifecycle hooks 2026-04-17 10:02:00 -04:00
ice.go feat(webrtc): add ICE config helper (Configuration + SettingEngine) 2026-04-17 08:46:27 -04:00
ice_test.go feat(webrtc): add ICE config helper (Configuration + SettingEngine) 2026-04-17 08:46:27 -04:00
keyframecache.go feat(webrtc): add H.264 keyframe burst cache (issue #17) 2026-05-09 19:03:33 -04:00
peer.go feat(webrtc): add Connected() channel to Peer for ICE establishment timing 2026-05-06 15:55:42 -04:00
peer_test.go feat(webrtc): add PeerFactory, Peer, and RTP forwarder 2026-04-17 08:47:27 -04:00
registry.go feat(webrtc): add thread-safe Registry for stream_id -> SourceHandle 2026-04-17 08:44:59 -04:00
registry_test.go feat(webrtc): add thread-safe Registry for stream_id -> SourceHandle 2026-04-17 08:44:59 -04:00
source.go feat(webrtc): add -rtp-host flag + TrueNAS Docker deploy 2026-04-17 09:05:37 -04:00
source_test.go feat(webrtc): add Source with UDP RTP reader and subscriber fan-out 2026-04-17 08:45:48 -04:00
whep.go feat(webrtc): add WHEP POST handler (happy path) 2026-04-17 08:48:06 -04:00
whep_test.go feat(webrtc): add WHEP POST handler (happy path) 2026-04-17 08:48:06 -04:00
whip.go feat(core/webrtc): add IngestPeer for WHIP publish side (issue #16) 2026-05-09 16:20:09 -04:00