Skip to content

rust: port obs_source_video_render and its source_render_video and source_draw_route steps to obs-source #5962

Done

Description

@rdoupe

obs_source_video_render() (EXPORT) and its source_render_video(), source_draw_route() and get_type_format() steps in libobs/obs-source.c.h (~1092-1200 on master, a173a79) are still C. This is the entry point every scene item, projector, preview and filter target goes through to draw a source. Every decision in it is already Rust in obs-source's render route (obs_source_render_route_video_none, _async_update, _inactive, _draw, _draw_next and the _reads_* probes, PR #2208), and the draws it dispatches to are ported or hidden entries (obs_source_update_async_video #5940, obs_source_render_async_video #5943, obs_source_skip_video_filter #5827). What is left is the glue: the reference bracket, the source's fields read in their old order, the debug marker and the dispatch. It is the last caller-side step of the async-video series (#5938, #5941, #5948, #5951).

Behavior the port keeps, call for call:

  • obs_source_video_render(): obs_source_valid() check with its name, obs_source_get_ref(), source_render_video() on the reference, obs_source_release().
  • source_render_video(): type and flags read for the "no video" check (skip the filter when it has a parent); type and flags read again for the async check, rendering_filter read only when the route asks, then deinterlace_update_async_video() (only with deinterlacing on) and obs_source_update_async_video(); context.data and enabled read for the inactive check (skip the filter when it has a parent); then the debug marker bracket around the draw route.
  • source_draw_route(): filters.num, rendering_filter, info.video_render, filter_target and deinterlacing read one at a time, only when the route asks; the target's video_render and deinterlacing reads as the route defines.
  • The draw: obs_source_render_filters, obs_source_main_render, obs_source_video_render(filter_target), deinterlace_render, obs_source_render_async_video, or nothing.
  • get_type_format() and the marker exist only in _DEBUG builds; the port keeps that.

Plan, one PR into obs-source (the shape of #5940 and #5943):

  1. Extract the four functions verbatim into their own live core-source file (libobs/obs-source-video-render.c.h). No behavior change.
  2. Tier 1 RED in obs-source's existing category binary against a todo!() core over a trait for the fields and calls.
  3. GREEN: safe core in obs-source, obs_source_video_render as the exported C ABI in ffi/, a field shim, the extracted file moved to a reference-only ported group.
  4. Tier 3 parity against the original C in obs-c-oracle: the same source states through both, comparing the recorded reads and calls and their order.
  5. Tier 2: the existing cmocka cases that render through obs_source_video_render (filter skip, scene, async render/update) against the hybrid libobs and the C reference, plus a case for any route they don't reach (filter target, deinterlace).

No public header, C test or obs-websocket change.

Activity

  1. added
    enhancement
    port
    on Nov 29, 2026
  2. rdoupe commented on Nov 29, 2026

    @rdoupe
    CollaboratorAuthor

    /ready

  3. added
    ready
    on Nov 29, 2026
  4. rdoupe commented on Nov 29, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #5962 (obs_source_video_render and its source_render_video, source_draw_route and get_type_format steps), alone, on branch port/5962-video-render.

    1. Extract the four functions verbatim into libobs/obs-source-video-render.c.h (live core-source group), with a cmocka characterization of each draw route.
    2. Tier 1 RED in obs-source's existing category binary against a todo!() core over a Host trait for the fields and the calls.
    3. GREEN: safe core, the exported C ABI in ffi/, a fields adapter, the original moved to a reference-only ported group.
    4. Tier 3 parity in obs-c-oracle; Tier 2 against the hybrid and the C reference.

    First PR (draft, with the RED commit) within a few hours.

  5. added a commit that references this issue on Dec 4, 2026
    130e601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementportready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions