Skip to content

rust: port obs_source_default_render to obs-source #5893

Done

Description

@rdoupe

obs_source_default_render() (declared in libobs/obs.h, defined in libobs/obs-source.c.h) is still C. It draws a source with the core's default effect: the main render path calls it for sources without OBS_SOURCE_CUSTOM_DRAW, the Rust skip-video-filter and process-filter-begin ports call it through their adapters (obs-source-skip-video-filter-fields.c.h, obs-source-process-filter-begin-fields.c.h), and filter plugins call it through the C ABI (obs-filters GPU delay and scroll, nv-filters). Nothing in the issue list or open PRs covers it; #5827 and #2208 ported its callers, not it.

Behavior the port keeps:

  • Does nothing when source->context.data is NULL (a source whose create failed, or one being destroyed): no effect lookup, no technique begin.
  • Otherwise reads obs->video.default_effect, gets its "Draw" technique, calls gs_technique_begin() once, then for each pass gs_technique_begin_pass(tech, i), source_render(source, effect), gs_technique_end_pass(tech), and finally gs_technique_end(tech), in that order. Zero passes still begins and ends the technique.
  • No NULL check on source itself (callers pass a valid one), so a NULL source crashes as today.

Plan: move the body verbatim into its own libobs/obs-source-default-render.c.h in a live group, with source_render reached through a private seam; characterize it with a new cmocka case against hybrid libobs and the C reference (pass order, the zero-pass case, the NULL-data skip); then a safe core in obs-source over a trait (has data, default effect, technique, begin/end, pass begin/end, render), Tier 1 RED against todo!() in obs-source's existing source test binary, Tier 3 parity against the original C in obs-c-oracle, Tier 2 unchanged.

Activity

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

    @rdoupe
    CollaboratorAuthor

    Claiming: I'll extract, characterize and port it RED then GREEN in one PR, the shape of #5827.

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

    @rdoupe
    CollaboratorAuthor

    Continuing this one: branch port/5893-default-render, following the #5828 shape (extraction, characterization, RED, GREEN). Draft PR once the RED commit is in.

  5. added a commit that references this issue on Nov 29, 2026
    13854a4
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