Repository navigation
libobs: extract source theme icon callbacks verbatim (Refs #4695) - #4697
Merged
Merged
Conversation
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"}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.