Commit graph

8 commits

Author SHA1 Message Date
Nate
844db120d2 test: live end-to-end test for backpressure frame dropping (#30)
The gap test proves codec correctness across a drop; this one runs the real
server loop and proves the drop mechanism fires: a client reporting a high
decode backlog gets a stream with skipped frame indices (maxGap ~= MAX_CONSEC_DROPS),
while a client reporting zero backlog gets every frame in order. Spawns
stream_server.py against an ffmpeg-generated clip; keeps stdin open because the
server's command loop runs on the main thread and dies on EOF.
2026-06-22 12:20:39 -04:00
Nate
d9480e9f85 feat: server-side frame dropping under client backpressure (#30)
The live WebSocket pushed every frame on a wall-clock schedule regardless of
whether the client could keep up. On a slow device frames piled into the client
decode queue, and the client paid the inflate+delta-patch cost for each one
before dropping the excess in its render loop. CPU spent on frames never shown.

Client now reports its decoded-frame backlog (frameBuffer depth) ~4x/sec over
the existing command channel. When the backlog exceeds BACKLOG_HIGH the server
skips frames: it advances the source cheaply (grab, no decode/encode/send) so
video stays time-aligned with audio, and crucially holds prev_frame across the
gap so the next sent frame is a correct delta against the last SENT frame. No
keyframe resync needed - deltas are always relative to the last sent frame.
MAX_CONSEC_DROPS caps the gap and guarantees liveness for slow/non-reporting
clients. Fully backward compatible: a client that never reports keeps backlog=0
and behaviour is unchanged.

test/test_backpressure_gap.js encodes a keyframe + a dropped gap via codec.py
and decodes through the shipped codec.js, asserting the post-gap frame is
reconstructed bit-exact (and is a real DELTA), matching the no-drop path.
2026-06-22 12:12:38 -04:00
SteadyW
8e70e3feb6
Rename test_ytdl_normalize.py to test_ytdl_normalize.py 2026-06-21 11:29:45 +03:00
SteadyW
cca6f170a9
Rename test_ytdl_hardening.py to test_ytdl_hardening.py 2026-06-21 11:29:30 +03:00
SteadyW
9cc93a0a36
Add test_ytdl.py for testing functionality 2026-06-21 11:29:13 +03:00
SteadyW
52ae40ec9c
Rename test_e2e.js to test_e2e.js 2026-06-21 11:28:38 +03:00
Shaku-Med
c230c6b7d7 feat: make hover thumbnails optional (--no-thumbnails)
Thumbnails stay on by default. --no-thumbnails skips building the preview sprite, so the server does no extra work and the rest of the player still works. The frontend already shows no preview when the sprite is unavailable.
2026-06-19 00:14:34 -04:00
Shaku-Med
743e6e933c test: cover the scrub sprite endpoint (hover thumbnails)
Self-contained: generates a tiny video, checks the sprite grid math, the JPEG output, and the /scrub + /scrub_sprite endpoints. The ffmpeg parts skip if ffmpeg is missing.
2026-06-18 11:41:49 -04:00