Skip to content

rust: Port output weak-handle lifetime to obs-output #4778

Closed

Description

@zackees

Port exactly the five functions isolated by prerequisite #4768 from libobs/obs-output-weak-lifetime.c.h to obs-output: obs_weak_output_addref, obs_weak_output_release, obs_output_get_weak_output, obs_weak_output_get_output, and obs_weak_output_references_output.

Phase 6 core work; land #4768 before the Rust swap. The prerequisite branch is test/4768-output-weak-lifetime; the pool manager publishes it after native-graph serialization permits. Keep obs_output_get_ref, the existing shared atomic primitives, allocator ABI, and output creation/destruction outside this unit. Preserve the private get_weak dependency through a real private adapter if needed. This unit is disjoint from #4755 / #4762 (obs_get_output_source).

The existing C characterization is test/cmocka/test_output_weak_lifetime.c, registered once in the native test graph. Preserve its assertions and leave it and public headers unchanged. It pins NULL handling, owners-minus-one counter semantics, weak acquisition/addref/release and final freeing, live strong promotion, expired promotion, stored-pointer identity independent of expiry, and a real output's lifetime across promoted and external weak owners. Existing test_obs_enum_outputs_removal.c remains regression coverage.

Follow the testing policy: RED Tier 1 tests against a stub in the existing Core state category (obs-tests-core), then GREEN safe Rust core and thin ABI shims; layout and Tier 3 differential coverage against the retained C implementation, including a mutation check. Keep allocation compatible with bmalloc/bfree, reference synchronization and C ABI intact, add genuine link support for any new C adapters, and run unchanged Tier 2 tests against hybrid libobs and libobs-c-reference plus symbol parity. Tier 4 does not apply to this local lifetime unit. Move only the extracted whole C file to a ported unity group when swapping it; do not change obs-websocket or unrelated output APIs.

Activity

  1. added
    enhancement
    port
    ready
    P2
    size:S
    on Nov 12, 2026
  2. zackees commented on Nov 12, 2026

    @zackees
    MemberAuthor

    Claiming: output weak-handle lifetime Rust swap on port/4778-weak-output-rust, stacked on test/4768-output-weak-lifetime at 49be903. 1. Commit RED Tier 1 characterization in obs-tests-core. 2. Port exactly the five weak-output functions with existing atomic primitives and allocation ABI, add layout/differential and real adapter link support. 3. Run focused tiers, mutation check, formatting and full lint, then push branch only for the landing worker; no PR in this assignment.

  3. moved this from In progress to Ready in obs-rust Multiviewon Nov 14, 2026
  4. rdoupe commented on Nov 16, 2026

    @rdoupe
    Collaborator

    @zackees are you still on this one? It was claimed on 2026-11-12, and port/4778-weak-output-rust has finished-looking commits from 2026-11-12 but no PR. If you've moved on, I can rebase that branch onto master, check it, and open the PR under your commits. I'll wait a day before taking it.

  5. zackees commented on Nov 16, 2026

    @zackees
    MemberAuthor

    Releasing #4778 — handing it to @rdoupe. There's a partial branch you're welcome to reuse or ignore: port/4778-weak-output-rust. Thanks for picking it up!

  6. rdoupe commented on Nov 17, 2026

    @rdoupe
    Collaborator

    Claiming: #4778. Thanks @zackees. I'll reuse the RED and GREEN commits from port/4778-weak-output-rust (the extraction half is already on master via #4824), rebase them onto master and check them against the testing policy:

    1. RED: Tier 1 tests in obs-tests-core against stubs for the five weak-output functions.
    2. GREEN: the Rust core and ABI shims, Tier 3 parity against the retained C with a mutation check, and the unchanged test_output_weak_lifetime against hybrid libobs and the C reference.
    3. One PR, Refs #4778.
  7. moved this from Ready to In progress in obs-rust Multiviewon Nov 17, 2026
  8. rdoupe commented on Nov 18, 2026

    @rdoupe
    Collaborator

    Done by #4942 (merged 2026-11-17): the five output weak-handle functions come from obs-output on master (rust-exports.d/obs-output-output_weak_lifetime.txt).

  9. moved this from In progress to Done in obs-rust Multiviewon Nov 18, 2026
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

    P2enhancementportreadysize:S

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions