Skip to content

test: Extract and characterize encoder weak-handle acquisition before Rust swap #5281

Closed as not planned

Description

@zackees

C-only Phase 6 prerequisite for obs_encoder_get_weak_encoder in libobs/obs-encoder.c.h:1573-1581, later targeting obs-encoder. This is distinct from rdoupe's source weak-handle swap #5228 and encoder weak identity #4037.

Pin the current C behavior using the real private encoder/control layouts and native-long atomic refcounts: NULL returns NULL without logging; a valid encoder returns exactly its context.control with precisely one weak increment per acquisition, repeated acquisitions retain pointer identity, and the strong count and encoder bytes do not change. Characterize NULL control through the existing NULL-tolerant addref and acquired handles surviving actual encoder release until explicitly released. Keep release, destruction, upgrade and packet ownership implementation out of scope.

Extract only the complete function verbatim into libobs/obs-encoder-get-weak.c.h in the sorted O group, libobs/build/libobs.core-output+.h.c. Preserve the private get_weak context projection, public API/ABI, addref ordering and C lifecycle. No Rust, public-header changes, existing-C-test changes, WebSocket edits or workflows.

Acceptance: new immutable C characterization with tests.d pointer and sorted canonical graph, agreeing inventories, RED then GREEN commits. Run the entire native_build:: module, focused Linux Tier 2 new target plus EVERY *_rust target, ci/windows_link_check.py and full lint once. Forced-fetch/merge-tree screen open encoder/O/graph PRs including #5273's #5280 and #5277. File the Rust swap separately after publication. No functional dependency; follows merged #5272 and #5263.

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: encoder weak-handle acquisition prerequisite in pool slot obs-studio5, branch test/5281-encoder-get-weak. 1. Add immutable C characterization with real encoder/control layouts and exact native refcounts, commit RED. 2. Extract the original body verbatim in group O, commit GREEN. 3. Verify native_build, focused Tier 2 including every *_rust target, Windows/Darwin links, lint and open-PR merge trees. Expect the READY prerequisite PR this session; the Rust swap will be a separate issue.

  3. zackees commented on Nov 19, 2026

    @zackees
    MemberAuthor

    Releasing: duplicate. #5246 (the shared native-link manifest, pushed head 15467c3) already moves obs_encoder_get_weak_encoder unchanged into libobs/obs-encoder-weak-refs.c.h together with obs_weak_encoder_addref and obs_weak_encoder_release, and #5280 builds on it. The local WIP branch test/5281-encoder-get-weak (9a3606ffd) stays unpushed.

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

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions