mirror of
https://github.com/livekit/livekit.git
synced 2026-07-10 12:12:57 +00:00
96ae9cc59e
When a down track is added, replay the publisher's most recent group-of-pictures so the subscriber gets a decodable stream immediately, instead of triggering a PLI that spikes the publisher uplink and re-sends a key frame to every subscriber. The cache is opt-in per published track via EnableVideoCaching (with VideoCachingMaxDuration bounding the cached GOP); when disabled the ingest and bucket-sizing paths are byte-for-byte the original logic. Adds hit/miss and forwarded-PLI counters for observability. Squashed from branch duan/video-frame-cache-relay (video frame caching only; the start-at-desired-quality work is already in master). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>