Skip to content

rust: Port libobs/obs-properties.c to obs-properties #828

Closed

Description

@zackees

Unit

libobs/obs-properties.c (1415 lines, 108 exported functions in obs-properties.h) to a new obs-properties crate.

Phase and position

Phase 6, tracker #444: the next core seam after obs-data.c (#784, #801). #444 lists obs-properties.c, the hotkey name map and the effect/shader parser as separately claimable; this is the first of them.

Dependencies and existing tests

Depends on bmem, darray (ported) and obs_data (ported, #801) for the settings passed to modified callbacks. No cmocka test exercises obs_properties_*/obs_property_* directly (only plugin tests that build properties incidentally), so a characterization test test/cmocka/test_obs_properties.c lands first, C only.

Notes

  • One libobs-internal touch: obs_property_button_clicked reads ((struct obs_context_data *)obj)->data. The port keeps that layout read through a narrow C accessor, not a Rust mirror of obs_context_data.
  • Opaque handles only (obs_properties_t, obs_property_t); the header is not edited.
  • Callbacks (modified, modified2, button, the group/parent chain via get_topmost_parent) cross the FFI boundary in both directions: Tier 3 drives both sides with the same C callbacks.
  • Odd cases (lookups by name across groups, obs_properties_add_* duplicate names, list item removal, obs_properties_apply_settings ordering) are pinned as characterized, not endorsed.

Activity

  1. added
    enhancement
    port
    on Oct 15, 2026
  2. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Claiming: libobs/obs-properties.c

    1. Characterization PR, no Rust: test/cmocka/test_obs_properties.c pins creation and destruction, every obs_properties_add_* type and its getters/setters, lookup by name including inside groups, duplicate names, list items (add/insert/remove/clear, disabled items), modified/modified2/button callbacks and the topmost-parent chain, obs_properties_apply_settings, groups and obs_properties_get_parent. Odd cases marked characterized, not endorsed.
    2. RED: obs-properties crate with todo!() cores, Tier 1 1:1 port of that test, Tier 3 parity against the C compiled as an oracle.
    3. GREEN: the port, ENABLE_RUST_LIBOBS=ON drops obs-properties.c.

    First PR (step 1) today.

  3. added
    claimed
    on Oct 15, 2026
  4. zackees commented on Oct 15, 2026

    @zackees
    MemberAuthor

    Done: #830 characterized obs-properties.c (C only) and #832 ported it to the obs-properties crate (Tier 1 1:1, Tier 3 parity on random call sequences against the original C, Tier 2 245/245 OFF and ON; ENABLE_RUST_LIBOBS=ON drops the C file).

    Intentional differences, all where C crashes or leaks: null names and obs_properties_get_parent(NULL) return null; inserts past the end are ignored; a set added to two groups is shared, not double-freed; neither leak from #831 is reproduced.

    Left: #831 (fix the two leaks in the C original).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimedenhancementport

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions