Skip to content

obs-core: swap obs_enum_sources, obs_enum_all_sources, obs_enum_canvases and obs_canvas_enum_scenes to Rust #5495

Closed

Description

@rdoupe

Phase 6 follow-up (#444) to the C-only characterization and extraction of the source and canvas enumerators (#5493, PR #5494).

Port libobs/obs-enum-sources.c.h (obs_enum_sources, obs_enum_all_sources, obs_enum_canvases, obs_canvas_enum_scenes, and the static obs_enum_uuid they share) into obs-core, keeping the public C API and ABI unchanged. Preserve, for each:

  • obs_enum_sources: under sources_mutex, walks obs->data.sources in uuid-table order; takes a reference on each, skipping one with no reference left; skips private sources; calls back for inputs and for groups only; a false return stops the walk; every reference taken is released.
  • obs_enum_all_sources: every source in the uuid table, private ones and sources with no reference left included, no reference taken; stops on false.
  • obs_enum_canvases: every named canvas under canvases_mutex, no reference taken; stops on false.
  • obs_canvas_enum_scenes: under the canvas's sources_mutex, the canvas's scenes in order, each referenced for the call and released after; stops on false.

The walks over private state (the hash links, the mutexes, the reference get/release, the source type and id, the private flag) stay C behind one hidden adapter file in the core group; the decisions move to Rust, as obs_enum_scenes did (enum_scenes.rs).

Mirror the test_enum_sources assertions in Tier 1 (the existing obs-tests-core binary, no new executable), keep Tier 2 (test_enum_sources, test_enum_scenes) unchanged against hybrid libobs and libobs-c-reference, and add Tier 3 oracle parity: the original and the shim over recording stand-ins for the adapter steps, comparing the visit order, the references taken and released, the locks and the early stop over proptest source lists, with mutants. Tier 4 does not apply. Move the extracted file into its own ported group. Preserve existing C tests and public headers.

Activity

  1. rdoupe commented on Nov 23, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #5495

    1. RED: Tier 1 mirrors of every test_enum_sources case in obs-tests-core against a todo!() core.
    2. GREEN: the four walks' decisions in obs-core, the hash links, mutexes, references and source fields behind one hidden adapter file in the core group; the original moves to its own ported group for the C reference. Tier 3 parity over recording stand-ins with mutants; Tier 2 test_enum_sources and test_enum_scenes on both libraries.

    Stacked on the extraction (PR #5494) until it lands.

  2. added
    enhancement
    port
    on Nov 23, 2026
  3. added
    ready
    on Nov 23, 2026
  4. rdoupe commented on Nov 23, 2026

    @rdoupe
    CollaboratorAuthor

    Done by #5496 (merged).

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