Skip to content

libobs: extract source theme icon callbacks verbatim (Refs #4695) - #4697

Merged
zackees merged 2 commits into
masterfrom
test/source-theme-icon-extract
Nov 11, 2026
Merged

zackees merged 2 commits into
masterfrom
test/source-theme-icon-extract

Conversation

@zackees

@zackees zackees commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

The theme icon getters remain embedded in obs-source.c.h, preventing a whole-file Rust swap. This prerequisite first adds actual-library C characterization (ff659ff), then moves obs_source_get_dark_icon and obs_source_get_light_icon verbatim into obs-source-theme-icon.c.h in sorted unity position (b3d371682). No Rust, API, or behavior changes are included. Refs #4695; the Rust swap follows in #4696 after this lands.

The six characterization cases pin NULL IDs with an empty core registry, missing/unknown IDs, every declared non-CUSTOM icon type skipping callbacks, independent optional dark/light callbacks, exactly one callback with exact NULL/non-NULL type_data, borrowed NULL/empty/raw-byte/string results and pointer identity, mutable backing storage, duplicate registration retention, and byte-exact/case-sensitive/NUL-terminated ID lookup. No source instance is created, no instance-data getter or name callback is used, and the registry is released by normal obs_shutdown.

obs_startup registers built-in sources before returning. The NULL-ID case therefore observes the empty registry through a synchronous startup log callback after obs_initialized becomes true and before source registration, verifying emptiness with obs_enum_source_types before calling both real exports. It restores the original handler. NULL IDs in a populated registry and calls without a core remain outside the existing C contract; the extraction adds no guard. The initial fixture assumed the post-startup registry was empty and faulted; that fixture was corrected before the characterization commit.

Validation: the identical new test plus unchanged test_output_type_info and test_encoder_type_info passed three repeats each against both actual libraries before and after extraction (18 suite executions per phase, no skips). ldd confirmed each library path; all 1,768 dynamic exports matched in each phase. Both moved bodies are byte-for-byte identical to the characterization commit; the parent differs only by removal of that span and adjacent blank line. All ten build-group checks, Rust fmt, git diff --check and self-review passed. Full SOLDR_PORCELAIN=0 ./lint ran exactly once with a 1,800-second deadline and passed.

This is the characterization/extraction prerequisite, so Rust RED/GREEN, Tier 1 mirrors, original-C Tier 3 differential/mutation coverage and C-layout adapters belong to #4696. Tier 4 does not apply. Full Tier 2, native Windows/macOS execution, sanitizers and hosted CI completion are not claimed. No existing C test, public header, obs-websocket file, workflow, test-graph.json or native.rs changed; no Rust test executable or feature-ledger entry is added.

Ci-Attestation: {"at":1794398811,"gate":"rust/all/fmt","host":"linux-x86_64","key":"","lane":"lint","parents":["ff659ff9ea0236f8477b74e9f374935840dc32da"],"secs":168,"stamp":"8ac47a854f967bcd4f589fb87bca23f1","tree":"6aa32ea3ffe0c6963bd1c8ecc200942855131a43","v":1,"via":"run"}
Ci-Attestation: {"at":1794398811,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"","lane":"lint","parents":["ff659ff9ea0236f8477b74e9f374935840dc32da"],"secs":168,"stamp":"5578765ce26967a7adee014c3e182838","tree":"6aa32ea3ffe0c6963bd1c8ecc200942855131a43","v":1,"via":"run"}
Ci-Attestation: {"at":1794398811,"gate":"rust/x86_64-unknown-linux-gnu/dylint","host":"linux-x86_64","key":"","lane":"dylint","parents":["ff659ff9ea0236f8477b74e9f374935840dc32da"],"secs":168,"stamp":"602a1a321d9c511ad590118c082c29e4","tree":"6aa32ea3ffe0c6963bd1c8ecc200942855131a43","v":1,"via":"run"}
@zackees
zackees enabled auto-merge November 11, 2026 12:07
@zackees
zackees added this pull request to the merge queue Nov 11, 2026
Merged via the queue into master with commit a9a143f Nov 11, 2026
41 checks passed
@zackees
zackees deleted the test/source-theme-icon-extract branch November 11, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant