Repository navigation
Done
Labels
enhancementNew feature or requestportPort a C unit to Rust (four-tier policy)readyMeets the definition of Ready; claimable
Description
async_tick() in libobs/obs-source.c.h (~528-556 on master, 90aaafe) and its two static steps, filter_frame() (~502) and get_closest_frame() (~1677), are still C. They are what obs_source_video_tick() runs once a frame for every async source. Every decision in them is already Rust: the route (obs_source_video_tick_async_route(), obs-source-video-tick.c), the frame pacing (obs_source_async_pacing(), obs-source-async-pacing.c) and the async filter chain (filter_async_video(), #5917). What is left is the glue on the source's fields, async_mutex, the frame queue and the frame refs.
Behavior the port keeps, call for call:
async_tick(): read the frame time from the video stats before the lock; underasync_mutex, ask the route withdeinterlacing_enabled(); DEINTERLACE runsdeinterlace_process_last_frame(), CLOSEST releasescur_async_framethroughremove_async_frame()and takesget_closest_frame(). Then storelast_sys_timestamp, ask the route again (it readsdeinterlace_modea second time), filterprev_async_frameonly on DEINTERLACE, thencur_async_frame, and setasync_update_texturefromset_async_texture_size()when a current frame is left.filter_frame(): on a frame, incrementrefs, runfilter_async_video(), decrementrefson what comes back (the frame the chain returned, not the one passed in), store the result. No frame: the slot is stored as NULL.get_closest_frame(): no queued frame returns NULL. Otherwise copy each queued timestamp (heap-allocated pastMAX_ASYNC_FRAMES, the stack array otherwise), ask the pacing, erase andremove_async_frame()the dropped frames off the front one at a time, storelast_frame_ts, and take the front frame when the pacing says so.
Plan, one PR into obs-source (the shape of #5916 and #5926):
- Extract the three functions verbatim into
libobs/obs-source-async-tick.c.h(livecore-sourcegroup). No behavior change. - Tier 1 RED in obs-source's existing category binary against a
todo!()core over a trait for the field reads/writes, the queue, the mutex and the calls. - GREEN: safe core in
obs-source, the export as C ABI inffi/, a field shim with noEXPORT, the extracted file moved to a reference-only ported group. - Tier 3 parity against the original C in
obs-c-oracle: the same queue, timestamps, routes and filter results through both, comparing fields, the queue, refs, calls and their order. - Tier 2: a new cmocka test of an async source through a tick (empty queue, frames dropped and taken, a filter that replaces or drops the frame, the deinterlace route) through the hybrid libobs and the C reference. The existing async tests run unchanged.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestportPort a C unit to Rust (four-tier policy)readyMeets the definition of Ready; claimable
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Nov 29, 2026
/ready
rdoupe commentedon Nov 29, 2026
Claiming: #5929 port of async_tick and its filter_frame and get_closest_frame steps (extract, Tier 1 RED, GREEN, Tier 3 parity, Tier 2). No other issues in the batch; first PR (draft, at the RED commit) today.
obs-source: port async_tick and its steps to Rust, GREEN (Fixes #5929)
libobs: extract async_tick and its steps verbatim (Refs #5929)
obs-source: Tier 1 for async_tick and its steps, RED (Refs #5929)
obs-source: port async_tick and its steps to Rust, GREEN (Fixes #5929)
obs-c-oracle: keep source_video_tick_callbacks.c stdio declarations o…
obs-source: port async_tick and its filter_frame and get_closest_fram…