You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port the async video frame pacing in obs-source.c to obs-source #2024
Port the async video frame pacing in libobs/obs-source.c.h to rust/obs-source, as a new module async_pacing.
What moves:
ready_async_frame:
the unbuffered "newest only" rule;
the timing jump on frame_out_of_bounds;
the catch-up walk, with its 2 ms duplicate guard and the MAX_TS_VAR re-anchor;
get_closest_frame: the first-frame rule and the last_frame_ts seed.
What stays C: da_erase, remove_async_frame, the async cache, async_mutex (the caller holds it), and the frame pointers. C copies the queue's timestamps (at most MAX_ASYNC_FRAMES) into a stack array. Rust returns how many frames to drop from the front, whether to take the first, and the new last_frame_ts. C then erases and takes in the same order as today. frame_out_of_bounds stays an inline for obs-source-deinterlace.c.h, and Rust gets its own copy.
Plan (one PR, separate commits)
A behaviour-neutral move into libobs/obs-source-async-pacing.c.h, as a hidden function.
Characterization: test_async_frame_pacing_steps, against a model queue. It covers:
unbuffered with 1, 2 and 30 frames;
last_frame_ts == 0;
the jump at MAX_TS_VAR ± 1, both ways;
the 2 ms guard at its edges;
the re-anchor inside the walk;
timestamps going backwards, and a system clock that goes backwards;
30 frames all in the past.
RED, then GREEN: the safe Rust core plus shims, in a libobs.ported-source-async-pacing group. Exported symbols are unchanged.
Tier 3 parity against the original C, plus a deliberate-break check and port_comparison numbers. Parity covers:
a proptest over full-range u64 queues of 1–30 frames;
sequences modelling 23.976, 25, 29.97, 30, 50 and 60 fps sources into 30 and 60 fps canvases, buffered and unbuffered, with jitter and jumps.
These real-libobs tests must stay green on every lane: test_media_restart_stale_frame, test_media_restart_first_frame, test_async_delay_audio and the v4l2 tests.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2024.
obs-source: Port the async video frame pacing (obs-rust#2046)