You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: port get_source_info2 and obs_enable_source_type to obs-source #6014
get_source_info2() (libobs/obs-source.c.h, the versioned source type lookup that obs_register_source_s() uses to refuse a duplicate registration) and the hidden export obs_enable_source_type() (same file, used by the scripting layer to disable and re-enable a source type it redefines) are still C. Their sibling get_source_info() is already Rust (#4608, rust/obs-source/src/ffi/source_info_lookup.rs), over the private registry view in libobs/obs-source-info-lookup-fields.c.h.
Behavior the port keeps:
get_source_info2(unversioned_id, ver): the first entry of obs->source_types, in registration order, whose unversioned_id equals the asked one bytewise and whose version equals ver; NULL when there is none. The entry's own address is returned (callers keep it).
So obs_register_source() refuses a second registration of the same ID and version ("Source '%s' already exists! Duplicate library?"), and accepts the same ID with another version.
obs_enable_source_type(name, enable): does nothing for an unknown (full, versioned) ID; otherwise clears OBS_SOURCE_CAP_DISABLED in the type's output_flags when enable, sets it otherwise, and leaves every other flag as it was.
Characterize in a new cmocka test on both builds: duplicate and other-version registrations through obs_register_source(), and obs_enable_source_type() seen through obs_get_source_output_flags().
Extract the two bodies verbatim into their own live file in libobs.core-source.
Tier 1 RED against todo!() cores in obs-source's existing test binary; GREEN: Rust get_source_info2 and obs_enable_source_type over the same registry adapter (new accessors for unversioned_id, version and output_flags), Tier 3 parity against the original C in obs-c-oracle.
A NULL asked ID finds nothing, as get_source_info() already does (the C passes it to strcmp).
Claiming: get_source_info2 and obs_enable_source_type port to obs-source (characterize, extract, Tier 1 RED, GREEN with Tier 3 parity), the shape of #4608.
Activity
rdoupe commentedon Nov 30, 2026
Claiming: get_source_info2 and obs_enable_source_type port to obs-source (characterize, extract, Tier 1 RED, GREEN with Tier 3 parity), the shape of #4608.
test: characterize the versioned source type lookup and obs_enable_so…
libobs: extract get_source_info2 and obs_enable_source_type verbatim …
obs-source: Tier 1 for get_source_info2 and obs_enable_source_type, R…
obs-source: port get_source_info2 and obs_enable_source_type to Rust (F…
obs-c-oracle: build the renamed obs_enable_source_type without EXPORT…
obs-source: port get_source_info2 and obs_enable_source_type to Rust (F…