Repository navigation
Description
Scout D / rank 5: C-only prerequisite for the remaining Phase 6 core type-catalog enumeration, later targeting obs-core. Snapshot: master a62bfe717d5d9610a5136ca211273e66a1ae1f84 (2026-11-19 UTC).
Context and scope
Exported entry points: obs_enum_input_types, obs_enum_filter_types, obs_enum_transition_types, obs_enum_output_types, obs_enum_encoder_types, obs_enum_service_types. Live C definitions: libobs/obs.c.h:1777-1783,1809-1847; public declarations remain in the unchanged libobs headers.
Move only these public bodies verbatim to proposed libobs/obs-type-catalog-enum.c.h, within the existing libobs/build/libobs.core+.h.c PCH family. Preserve signatures, behavior, field-read/callback/lock order and all private dependency semantics. This prerequisite contains no Rust; a separate whole-file Rust-swap issue/PR follows after it lands.
Rust-side confirmation: rust/obs-core/src/ffi/source_type_enum.rs:44-87 exports obs_enum_source_types and obs_enum_input_types2 only. The completed earlier issue explicitly excludes obs_enum_input_types and other registries. Exact-name hits for all six selected symbols are native integration calls/test strings and comments, with zero Rust ABI definitions. obs_enum_output_types_with_protocol is a separate callback-based API in the core-output group.
Characterization and build brief
Extract exactly the six legacy index-to-ID catalog readers, excluding obs_get_latest_input_type_id between them. For each independent input/filter/transition/output/encoder/service array, index >= num returns false and leaves the output slot unchanged; a valid index writes that array entry id and returns true. Pin empty/populated lists, insertion order, first/last valid, num, SIZE_MAX, distinct per-catalog sentinels and borrowed pointer identity. A failed lookup may receive NULL output because no write occurs; successful NULL output and no-core calls remain outside the original contract. No callbacks, locking, allocation, registration or filtering are introduced.
Existing coverage to preserve: test/cmocka/test_source_registration.c; test/cmocka/test_source_type_enum.c:177; test/cmocka/test_register_short_info.c; test/cmocka/test_module_type_rules_steps.c:743-784; test/cmocka/test_encoder_type_info.c:114-120; test/cmocka/test_output_type_info.c:146. They pin several callers; add a compact focused bounds/identity table only for missing cases.
Dependencies and sequencing: No functional prerequisite. Reuse the existing source_type_enum safe bounds/output machinery where appropriate, extending narrow private registry field selection without changing its existing APIs. This unit is core catalog metadata in obs.c.h/libobs.core+.h.c; it does not touch obs-output.c.h, obs-encoder.c.h, their instance operations, or libobs.core-output+.h.c. Keep obs_enum_source_types/obs_enum_input_types2 unchanged.
Acceptance criteria
- Reuse applicable existing C characterization unchanged. Add a new focused test only for missing coverage, proving baseline behavior against original C first. Record RED for the missing extraction seam/new focused contract before GREEN; when assertions already cover the entire contract, use an extraction/build contract instead of redundant behavioral tests.
- Land a separate behavior-neutral C-only extraction commit/PR before the Rust swap. No public-header/signature edits, no existing C-test edits, no WebSocket plugin modifications and no new workflow files. Scope unity-local aliases and undefine them at file end; keep sorted source membership and native metadata consistent.
- Run focused unchanged/new C tests against both libobs-c-reference and hybrid libobs; retain identical public symbol sets and validate affected native-build registrations. Run repository lint once. Preserve fixture host conditions and check Windows MSVC fixture linkage as applicable (no max_align_t or invalid enum sentinels). New threading fixtures use synchronization and the policy's 100-repeat determinism check, not sleeps.
- Later swap: Tier 1 mirrors every unchanged C assertion in safe Rust, with a committed failing stub before GREEN. Tier 2 retains the unchanged C tests, real-header size/alignment/all-field-offset checks for any exposed layout, and symbol parity. Tier 3 compares the thin ABI shim and safe core against the original extracted C oracle, with bounded edge/random cases and a demonstrated mutation failure. Respect existing documented oracle exclusions; introduce no behavior changes here.
- Add Rust cases only to the existing Core state category (
soldr cargo test -p obs-data --test obs-tests-core), with the existing owningobs-coresuite modules, never another Rust test executable. Link every real private adapter into affected standalone Rust-static consumers; never use aborting link stubs. Reject NULL owner tokens before field accessors where the original contract permits NULL. Rust through soldr, Python through uv; publication through ./push. - Tier 4 is inapplicable to this non-protocol extraction; keep the unchanged C++ WebSocket plugin compatibility contract. Exercise existing relevant black-box coverage if a later swap changes an externally observed protocol path.
Append points / lane TC / core: libobs/build/libobs.core+.h.c, libobs/build/modules.d/core.json and applicable existing source inventories. Proposed new coverage only: test/cmocka/test_type_catalog_enum.c, its tests.d fragment and sorted test graph registration when needed. Later Rust append points: rust/obs-core/src/lib.rs, src/ffi/mod.rs, existing category suite modules, per-unit export/source/oracle fragments and real-adapter link support. Every selected Scout D unit shares this physical core unity group: run at most one at a time and rebase between sibling landings.
Decisions
P2 / port / size:S / ready: one small deterministic extraction/characterization prerequisite, with no functional prerequisite on another unmerged conversion. The later Rust implementation and behavior fixes are separate work. Names above are proposed and may follow equivalent current conventions. All selected bodies live outside core-source, graphics and core-output unity groups; leave those busy groups and source/canvas/scene-item, graphics-backend and output/encoder instance implementations untouched. Refresh Ready/comments/open PRs before claiming. This issue is unclaimed; the scout posted no Claiming comment.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Nov 19, 2026
Claiming: #5170 core type-catalog enumeration prerequisite in pool slot obs-studio2 (test/5170-type-catalog-enum). 1. Add portable test-owned catalog characterization and record the missing-extraction RED contract. 2. Extract exactly the six C bodies verbatim and reconcile sorted unity/native inventories. 3. Run whole native_build, focused dual-library Linux Tier 2 plus unrelated Rust-static targets, and lint once; publish subject to backpressure and file the Rust-swap follow-up. First PR expected this session. Sibling scopes #5169/#5171-#5173 and #5175 remain untouched.
zackees commentedon Nov 19, 2026
Landed on master in #5201 (8d32f4c): the core type-catalog enumeration is characterized with test-owned types and extracted. The Rust swap is #5202.