Repository navigation
Description
obs_source_main_render() and obs_source_render_filters() in libobs/obs-source.c.h (~555-568 and ~667-690 on master, 68c8fae) are still C. They are the two draws obs_source_video_render() makes, which is Rust since #5963; it reaches them through the hidden adapters obs_source_video_render_main_render() and obs_source_video_render_render_filters(). Every decision in them is already Rust (obs_source_render_route_main_custom_draw, _srgb_aware, _default_effect, _reads_filters, #2208), and source_render() already has a hidden adapter (obs_source_default_render_source_render()). What is left is the field reads, the lock and the calls.
Behavior the port keeps, read for read and call for call:
obs_source_render_filters(): underfilter_mutex, take a reference tofilters.array[0]; unlock; setrendering_filter, callobs_source_video_render()on that filter, clearrendering_filter, release the reference.obs_source_main_render(): readinfo.output_flagsonce; readfilter_parent, andfilters.numonly when the route says it reads filters; when not sRGB aware, savegs_get_linear_srgb()and set it false, restoring it after the draw; default effect:obs_source_default_render(); otherwise, only whencontext.datais set,source_render()with NULL for a custom draw orgs_get_effect().
Plan, one PR into obs-source (the shape of #5940, #5963, #5968):
- Extract both functions verbatim into their own live
core-sourcefile (for examplelibobs/obs-source-video-render-draws.c.h), the adapters calling them unchanged. No behavior change. - Tier 1 RED in obs-source's existing category binary against a
todo!()core over a trait for the fields, the lock, the references and the calls. - GREEN: safe core in
obs-source, the two adapters as hidden C ABI exports inffi/, a one-access field adapter, the extracted file moved to a reference-only ported group. - Tier 3 parity against the original C in
obs-c-oracle: the same source states through both, comparing recorded reads and calls and their order, with clobbers that change fields mid-call (filters.numread only on its route,rendering_filterseen set by the filter's draw). - Tier 2: the existing cmocka cases that reach them through
obs_source_video_render()against the hybrid libobs and the C reference, plus a characterization of the two draws if a route is not reached.
No public header, C test or obs-websocket change.
Metadata
Metadata
Assignees
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Nov 30, 2026
/ready
rdoupe commentedon Nov 30, 2026
Claiming: #5972 port of obs_source_main_render and obs_source_render_filters (extract, Tier 1 RED, GREEN, Tier 3 parity, Tier 2), the next step after obs_source_video_tick (#5968).