Repository navigation
obs-properties: Port libobs/obs-properties.c - #832
Conversation
C only, no Rust: test_obs_properties pins creation, every property type's getters and setters, wrong-type defaults, lookup and removal through groups, tree-wide unique names, group recursion and clash checks, list and frame-rate items, buttons, and the modified/ apply_settings callback order. Odd cases are marked characterized, not endorsed. Refs #828
New obs-properties crate: C ABI shims for all 109 obs-properties.h exports over a safe core whose functions are todo!() stubs. - Tier 1 (tests/obs_properties.rs): 1:1 port of test_obs_properties. - Tier 3 (tests/parity.rs): random call sequences on Rust and on the original obs-properties.c compiled as oracle_*, comparing every result, callback and a full tree snapshot after each call. - ENABLE_RUST_LIBOBS=ON drops obs-properties.c; exports in rust-exports.d/obs-properties-obs_properties.txt. Refs #828
The safe core keeps each set's properties in insertion order as Rc<RefCell<Prop>>, a group owning its content set, with Weak parent links. The C ABI layer calls modified, clicked and destroy callbacks with no RefCell borrowed, so callbacks may change the tree. Lookup, tree-wide unique names, group checks, apply_settings order and every getter default follow the C; neither leak from #831 is reproduced. Refs #828
|
#830 merged; rebased onto master (replaced head |
|
Correction to my previous comment: that rebase did not run (the local branch name it used was gone), so the head stayed |
|
Second correction: the rebase push above was rejected because this PR is already in the merge queue, so the head is still |
Refs #828.
RED (
obs-properties: Test the port against todo!() stubs): a newobs-propertiescrate with C ABI shims for all 109obs-properties.hexports, over a safe core whose functions aretodo!(). Tier 1 aborts on the first stub (todo!("obs-properties port (#828)")intest_common_fields).tests/obs_properties.rs: 1:1 port oftest/cmocka/test_obs_properties.c(test: Characterize obs-properties.c before port #830).ENABLE_RUST_LIBOBS=ONdropsobs-properties.c; exports inrust-exports.d/obs-properties-obs_properties.txt.tests/parity.rs: random sequences of calls (every export: alladd_*types, groups with and without params, removal, setters, list and frame-rate items, callbacks, apply, click) run on Rust and on the originalobs-properties.ccompiled asoracle_*. After each call it compares every return value, every callback (name, which set, priv, param destroys) and a snapshot that calls every getter on every property in the tree.GREEN (
obs-properties: Port libobs/obs-properties.c): the safe core keeps each set's properties in insertion order asRc<RefCell<Prop>>; a group owns its content set; parents areWeaklinks. The C ABI layer calls modified/clicked/destroy callbacks with noRefCellborrowed, so plugin callbacks may look up, change, add and remove properties.obs_property_button_clickedreads the context through the exportedobs_obj_get_data, not a mirror ofobs_context_data.Intentional differences (documented in
ffi/obs_properties.rs), all where C crashes or leaks: null names andobs_properties_get_parent(NULL)return null; an insert past the end is ignored; neither leak from #831 is reproduced; a set added to two groups is shared, not double-freed.Local:
ci/local_gate.py --lane rust-testok (includes the Windows cross build).rust/tools/linux-validate/run.sh: 245/245 OFF and ON, export sets checked.apply_settings_orderfailsgroups_and_callbacks_match../lintok, including the oracle stand-in check (obs_obj_get_datacopied verbatim fromobs.c).One unrelated OFF-build failure on a first local run,
test_group_hide_transition_audio("no program audio was mixed"), passed on rerun; it does not touch this code.