Repository navigation
Description
Port the source-type registry enumeration unit from libobs/obs-source-type-enum.c.h to obs-core, after the C characterization/extraction prerequisite #4772 lands. Phase 6 core-state work; this is exactly obs_enum_source_types and obs_enum_input_types2. Leave obs_enum_input_types, metadata queries from #4733, and other registry APIs outside the unit.
Prerequisite branch: test/4772-source-type-enum-extract, commits 81870c80fb5fff955e3cd98fd4b85f714188ddad (characterization) and 8689dd93d2c0bc6eb9b939e7a58e8be6c9e824f7 (verbatim extraction). It is branch-only pending serialized publication of test-graph changes; no prerequisite PR exists yet. Treat #4772 as a blocking dependency and wait for its merge before starting the swap.
Preserve current behavior: source_types versus input_types selection and insertion order, size_t bounds including SIZE_MAX, borrowed ID pointer identity, no output writes on failure, input outputs independently optional (including both NULL), and unversioned output written last when the two output addresses alias. A successful source-type enumeration requires a writable non-NULL output pointer. The core/registries must be live and synchronized; no-core calls are outside the characterized domain. Do not add wrapper validation that changes this domain. Registration owns the versioned ID copy even for version zero; the unversioned ID remains the original caller pointer.
Acceptance and four-tier plan:
- RED: mirror every assertion from the unchanged
test/cmocka/test_source_type_enum.cin safe Tier 1 tests within obs-core's existingobs-tests-corecategory module, against a stub. Add no Rust test executable. GREEN then implements the safe core and thin C ABI shims. - Tier 2: keep the new characterization and existing
test_source_registration.cunchanged, run them against hybrid libobs and libobs-c-reference, and retain exact dynamic symbol parity and unchanged public headers. - Tier 3: compile the original extracted C as an oracle; add bounded differential cases for both registries, empty/populated states, valid/invalid indices, optional/aliased outputs, borrowed identities and unchanged failure sentinels. Measure any new C-layout boundary against real headers and show a mutation failure. Private C adapters must be real implementations with link support for standalone Rust-static consumers, never placeholders.
- Tier 4 does not apply: these functions expose no network protocol surface. The existing C++ obs-websocket plugin remains untouched.
Move only this unity group's include into its own ported group and per-unit source-set fragment when swapping. Register exports per FFI module, update the sorted Rust port ledger, run the required category/native-build gates and focused compatibility tests, and follow the standard claim/RED/GREEN/PR workflow after the prerequisite lands. No design decision is open.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Nov 12, 2026
Claiming: obs_enum_source_types and obs_enum_input_types2 Rust swap on branch port/4781-source-type-enum-rust, stacked on test/4772-source-type-enum-extract at 8689dd9 under the branch-only pool brief. 1. Mirror the unchanged characterization in safe Rust and commit failing stubs. 2. Implement the two-symbol swap with original-C differential coverage and real adapter link support, disjoint from #4733. 3. Run focused compatibility/category checks, fmt and one full lint, then push the branch for the landing worker. First branch handoff expected this session; no PR will be opened.
rdoupe commentedon Nov 16, 2026
@zackees are you still on this one? The extraction it was stacked on landed today as #4884 (your
test/4772-source-type-enum-extractbranch, rebased).port/4781-source-type-enum-rusthas three finished-looking commits on top of it from 2026-11-12 but no PR. If you've moved on, I can rebase those three onto master, check them, and open the PR with your authorship kept; otherwise I'll leave it with you.zackees commentedon Nov 16, 2026
Claiming: continuing the source-type enumeration swap in pool slot obs-studio4 on branch port/4781-source-type-enum-land. 1. Replay the existing RED then GREEN commits from port/4781-source-type-enum-rust onto current master with authorship preserved. 2. Verify the unchanged characterization, bounded C-oracle parity, native link support and final lint. 3. Open a PR with Refs #4781 and arm auto-merge pinned to its head this session. Scope remains obs_enum_source_types and obs_enum_input_types2 only.
feat(obs-core): swap source-type registry enumeration to Rust (Refs #…
test(obs-core): share the original input ID in registry fixtures (Refs …
test(obs-core): share the original input ID in registry fixtures (Refs …
rdoupe commentedon Nov 17, 2026
Done in #4897:
obs_enum_source_typesandobs_enum_input_types2now come fromrust/obs-core/src/ffi/source_type_enum.rs, with the C kept as the ported group's fallback and oracle.obs-core: Port source-type enumeration to Rust (Refs obs-rust#4781) (o…