Skip to content

design: Strategy for porting the libobs core (public ABI vs obs-internal.h) #146

Closed

Description

@zackees

Leaf-first porting won't reach the core. obs-source.c (≈6k lines), obs-scene.c, obs.c, obs-output.c and graphics.c share state through obs-internal.h by direct field access; even util/source-profiler.c reads obs->video.graphics. The policy treats "the existing C header" as the contract, which applied to obs-internal.h would freeze internal layouts forever.

Proposal to discuss:

  1. Two contracts: the public ABI (obs.h, opaque handles, exported functions) stays frozen; internal headers may change once all their C callers are ported or adapted.
  2. Strangler seams through opaque-handle subsystems first: obs-data.c (≈2.2k lines, used everywhere, parses untrusted JSON), obs-properties.c, the hotkey name map, the effect/shader parser.
  3. Make function extraction (as done for path-extension, cf-tokenizer, profiler-snapshot, dstr-libc) the standard way into large files.
  4. Move source-profiler.c here from Phase 4: it is core code.

Output: a testing-policy.md change and a Phase 6 tracker.

Activity

  1. added
    design
    on Oct 10, 2026
  2. zackees commented on Oct 13, 2026

    @zackees
    MemberAuthor

    Claiming: Phase 6 libobs-core strategy.

    1. Audit the public and internal ABI boundaries and candidate seams, including obs-data.c dependencies and existing tests.
    2. Update the testing policy to distinguish frozen public C ABI from changeable private internals and to define extraction/adapter rules for large files.
    3. File a claimable Phase 6 tracker, run the local gate, and open one documentation PR to master. First PR expected today.
  3. added
    claimed
    on Oct 13, 2026
  4. zackees commented on Oct 13, 2026

    @zackees
    MemberAuthor

    Completed in #445 (merge a3f3264). The testing policy now defines the public ABI/private core boundary, the obs-data first seam, and the source-profiler Phase 6 move. Follow-up work is tracked in #444. Local lint, unit suite, OFF/ON symbol parity, and the stamped local gate passed.

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

    claimeddesign

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions