Skip to content

libobs: characterize and extract source theme icon callbacks #4695

Closed

Description

@zackees

Prerequisite for the Phase 6 obs-source Rust swap: characterize obs_source_get_dark_icon and obs_source_get_light_icon in libobs/obs-source.c.h:4251-4267, then move both bodies verbatim into libobs/obs-source-theme-icon.c.h in sorted unity position. No Rust or behavior change belongs in this prerequisite.

Both use existing extern seams obs_source_get_icon_type and get_source_info (the latter declared in obs-internal.h); no private static helper or new seam is needed. #4608 changes the lookup implementation, not these wrappers.

Add a new actual-library C cmocka test with public source registration. Run identical tests against hybrid and C-reference before and after extraction: empty-registry NULL ID, unknown IDs, all non-custom icon types skipping callbacks, custom missing callbacks, exact NULL/non-NULL type_data, independent dark/light dispatch and call counts, borrowed return identity including NULL/empty/mutable storage, and byte-exact lookup/duplicate registration. NULL IDs in a populated registry and calls without a core are outside the existing C contract. No source instances or timing checks are needed.

The Rust swap follows after this prerequisite lands, with unchanged Tier 2 tests, Rust Tier 1 mirrors, original-C Tier 3 differential/mutation coverage and symbol parity. Tier 4 does not apply. Do not edit existing C tests, public headers, obs-websocket, workflows or the native test graph.

Activity

  1. added
    enhancement
    port
    ready
    P2
    size:S
    on Nov 11, 2026
  2. zackees commented on Nov 11, 2026

    @zackees
    MemberAuthor

    Claiming: source theme icon characterization and verbatim extraction. Branch: test/source-theme-icon-extract; pool slot: /home/niteris/dev/obs-rust/obs-studio2. 1. Pin current C behavior against both actual libraries. 2. Commit characterization, extract the two wrappers verbatim and rerun the identical suites. 3. Run full lint once and publish according to backpressure; file the Rust follow-up. First PR expected this session.

  3. moved this from In progress to Ready in obs-rust Multiviewon Nov 12, 2026
  4. zackees commented on Nov 12, 2026

    @zackees
    MemberAuthor

    Verified on origin/master 1273c7ea21c9c6fae1ba7bb3ba7425429dfebc56: extraction #4697 is merged at master commit a9a143f26ef09a42d0947665aa7d05da52e1c6b0. libobs/obs-source-theme-icon.c.h, its unity registration, test/cmocka/test_source_theme_icon.c and the actual-library tests.d fragment are present. The C characterization is byte-identical to the extraction merge, and the PR records verbatim extraction, before/after hybrid/reference characterization and dynamic-symbol parity. This issue explicitly scopes only that prerequisite, which is fully delivered. The separate Rust swap is #4696, already delivered by merged #4703 (master commit a041aed70bca72ad8d7c70ddac68e753ea0a85aa, also verified as an ancestor); its extracted unit is now in its own ported group. No remaining work in this prerequisite. Latest completed master push CI passed (run 43221554857). This audit did not rerun builds or runtime tests.

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

    P2enhancementportreadysize:S

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions