Skip to content

rust: Port libobs/obs-video-info-query.c.h to obs-core #5179

Closed

Description

@zackees

Phase 6 core follow-up to the C-only characterization and extraction in #5167. Wait for that prerequisite to land, then port the entire libobs/obs-video-info-query.c.h to obs-core, preserving the public obs_get_video_info C API/ABI and its current behavior.

The getter must reject a NULL core before calling any private C field adapter. It returns false without touching any output byte when the core, graphics or main-canvas mix is unavailable, in that short-circuit order. NULL output is safe on those unavailable paths only. With graphics and a mix, copy every field of the stored obs_video_info, including exact borrowed graphics-module pointer identity and unusual integer values, without validation, normalization, allocation or reference changes. A NULL mix video does not prevent success. Live video with NULL output remains outside the contract.

Keep private layout reads behind real C field adapters; measure size, alignment and every public obs_video_info field offset against unchanged real headers. Keep all existing C tests and public headers unchanged. The prerequisite's test_video_info_query is a deterministic real-header C-source fixture: relink that unchanged test to Rust and the real adapters in its graph registration, so it tests the replacement, not the retained C oracle. Retain actual-library test_no_core_getters and relevant existing setup/filename checks.

Commit failing safe-core Tier 1 mirrors before GREEN. Add cases only as modules in the existing obs-data --test obs-tests-core category with the owning obs-core suite. Tier 2 runs unchanged tests against C-reference and hybrid libraries with symbol parity. Tier 3 compares safe core and thin ABI shim against the original extracted C oracle using bounded random/edge cases and a demonstrated mutation failure. Tier 4 is inapplicable to this non-protocol getter; preserve the unchanged C++ WebSocket plugin.

Link each real adapter into every affected standalone Rust-static consumer using tests.d link-support fragments; never introduce aborting stubs or a placeholder global. Run ci/windows_link_check.py and a focused Linux Tier 2 build of at least two unrelated *_rust cmocka targets before publication. Type platform-width helpers/ranges as c_long/c_ulong directly rather than adding conversions that become useless on Windows. Use soldr for Rust, uv for Python and ./push for publication. Keep source/group inventories sorted and consistent and preserve the eight-category binary budget.

Acceptance: prerequisite merged; committed Tier 1 RED/GREEN; unchanged Tier 2 C cases pass both implementations; real-header layouts and public symbol sets match; Tier 3 parity and mutation evidence; native_build:: registration coverage, Rust-static Linux/Windows links and repository lint pass. No CI, public-header, existing-C-test or plugins/obs-websocket edits.

Refs #5167
Refs #1509
Refs #2566

Activity

  1. added
    portPort a C unit to Rust (four-tier policy)
    readyMeets the definition of Ready; claimable
    P2Normal priority
    on Nov 19, 2026
  2. zackees commented on Nov 19, 2026

    @zackees
    MemberAuthor

    Claiming: #5179 core video-info query Rust swap in pool slot obs-studio2, branch port/5179-video-info-query. 1. Commit failing safe-core characterization mirrors. 2. Implement the safe Rust core, thin ABI shim, real field adapters, unchanged Tier 2 wiring and Tier 3 oracle parity. 3. Validate native_build, obs-core, Windows links, focused Linux cmocka and lint; publish under backpressure policy. First PR expected this session.

  3. zackees commented on Nov 19, 2026

    @zackees
    MemberAuthor

    Landed on master in #5190 (cd6fe2a): the core video-info query now runs in safe Rust in obs-core. Every libobs_rust-static consumer gets the demand-linked real-adapter archive, with a regression test for that.

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

Metadata

Metadata

Assignees

Labels

P2Normal priorityportPort a C unit to Rust (four-tier policy)readyMeets the definition of Ready; claimablesize:SHours

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions