Repository navigation
Description
Scout D / rank 3: C-only prerequisite for the remaining Phase 6 core SDR-white and HDR-peak queries, later targeting obs-core. Snapshot: master a62bfe717d5d9610a5136ca211273e66a1ae1f84 (2026-11-19 UTC).
Context and scope
Exported entry points: obs_get_video_sdr_white_level, obs_get_video_hdr_nominal_peak_level. Live C definitions: libobs/obs.c.h:1693-1709; public declarations remain in the unchanged libobs headers.
Move only these public bodies verbatim to proposed libobs/obs-video-level-queries.c.h, within the existing libobs/build/libobs.core+.h.c PCH family. Preserve signatures, behavior, field-read/callback/lock order and all private dependency semantics. This prerequisite contains no Rust; a separate whole-file Rust-swap issue/PR follows after it lands.
Rust-side confirmation: Exact-name Rust hits are caller declarations, calls and comments in obs-source, obs-source-seam, obs-scene and obs-core::canvas_draw. rust/obs-core/src/ffi/core_setup_rules.rs:221-229 implements level-setting admission rules, not either public getter. No Rust ABI definition implements either query.
Characterization and build brief
Pin each query before startup and after shutdown: SDR white returns 300.0f and HDR nominal peak returns 1000.0f. A live core without graphics uses the same defaults; a graphics-present core returns the corresponding stored float unchanged. Distinguish the two fields with asymmetric sentinel values and exact float bits where defined, and check that the getter neither validates/clamps levels nor writes any state. Preserve the no-core check before taking &obs->video. Keep obs_set_video_levels and its already ported acceptance policy outside this unit.
Existing coverage to preserve: test/cmocka/test_no_core_getters.c:65-77; test/cmocka/test_video_levels_range.c:57-148 (defaults, valid stored values, invalid setter inputs retaining previous levels). Reuse unchanged baseline tests; add only no-graphics/field-routing gaps.
Dependencies and sequencing: No functional prerequisite. Keep both bodies in the existing core PCH family. A later Rust swap reads a validated opaque core through private fields; no graphics backend implementation or libobs/graphics file changes are needed. Preserve the default-versus-stored-value branch, not a new range policy.
Acceptance criteria
- Reuse applicable existing C characterization unchanged. Add a new focused test only for missing coverage, proving baseline behavior against original C first. Record RED for the missing extraction seam/new focused contract before GREEN; when assertions already cover the entire contract, use an extraction/build contract instead of redundant behavioral tests.
- Land a separate behavior-neutral C-only extraction commit/PR before the Rust swap. No public-header/signature edits, no existing C-test edits, no WebSocket plugin modifications and no new workflow files. Scope unity-local aliases and undefine them at file end; keep sorted source membership and native metadata consistent.
- Run focused unchanged/new C tests against both libobs-c-reference and hybrid libobs; retain identical public symbol sets and validate affected native-build registrations. Run repository lint once. Preserve fixture host conditions and check Windows MSVC fixture linkage as applicable (no max_align_t or invalid enum sentinels). New threading fixtures use synchronization and the policy's 100-repeat determinism check, not sleeps.
- Later swap: Tier 1 mirrors every unchanged C assertion in safe Rust, with a committed failing stub before GREEN. Tier 2 retains the unchanged C tests, real-header size/alignment/all-field-offset checks for any exposed layout, and symbol parity. Tier 3 compares the thin ABI shim and safe core against the original extracted C oracle, with bounded edge/random cases and a demonstrated mutation failure. Respect existing documented oracle exclusions; introduce no behavior changes here.
- Add Rust cases only to the existing Core state category (
soldr cargo test -p obs-data --test obs-tests-core), with the existing owningobs-coresuite modules, never another Rust test executable. Link every real private adapter into affected standalone Rust-static consumers; never use aborting link stubs. Reject NULL owner tokens before field accessors where the original contract permits NULL. Rust through soldr, Python through uv; publication through ./push. - Tier 4 is inapplicable to this non-protocol extraction; keep the unchanged C++ WebSocket plugin compatibility contract. Exercise existing relevant black-box coverage if a later swap changes an externally observed protocol path.
Append points / lane VL / core: libobs/build/libobs.core+.h.c, libobs/build/modules.d/core.json and applicable existing source inventories. Proposed new coverage only: test/cmocka/test_video_level_queries.c, its tests.d fragment and sorted test graph registration when needed. Later Rust append points: rust/obs-core/src/lib.rs, src/ffi/mod.rs, existing category suite modules, per-unit export/source/oracle fragments and real-adapter link support. Every selected Scout D unit shares this physical core unity group: run at most one at a time and rebase between sibling landings.
Decisions
P2 / port / size:S / ready: one small deterministic extraction/characterization prerequisite, with no functional prerequisite on another unmerged conversion. The later Rust implementation and behavior fixes are separate work. Names above are proposed and may follow equivalent current conventions. All selected bodies live outside core-source, graphics and core-output unity groups; leave those busy groups and source/canvas/scene-item, graphics-backend and output/encoder instance implementations untouched. Refresh Ready/comments/open PRs before claiming. This issue is unclaimed; the scout posted no Claiming comment.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Nov 19, 2026
Claiming: #5168 core SDR-white and HDR-peak query characterization and behavior-neutral extraction. Pool slot obs-studio5; branch test/5168-video-level-queries.
zackees commentedon Nov 19, 2026
Landed on master in #5188 (21667f4): the core SDR-white and HDR-peak queries are characterized with exact float bits and extracted. The Rust swap is #5187.