Skip to content

rust: Port libobs/obs-source-audio-capture-callbacks.c.h to obs-source #5243

Closed

Description

@zackees

Port only obs_source_add_audio_capture_callback and obs_source_remove_audio_capture_callback from libobs/obs-source-audio-capture-callbacks.c.h into obs-source after the C characterization/extraction prerequisite #5236 merges. Phase 6 source lane; use the existing Core state test binary, not a new Rust executable.

Preserve the immutable C characterization in test/cmocka/test_source_audio_capture_callbacks.c: invalid-source diagnostics before locking, append order and duplicate pairs, first exact matching removal, absent/repeated removal, NULL callback/parameter storage, exact pointer identity, one balanced lock/unlock on audio_cb_mutex, and zero callback invocation. Keep the source mutex, darray storage and bmalloc/bfree ownership in C. The real audio_cb_info layout includes native pointer alignment/padding; do not replace it with packed or assumed-width storage. Audio delivery and source teardown remain unchanged. No host device or new audio thread is needed.

Acceptance: Tier 1 mirrors against a RED stub then safe-core GREEN, original-C Tier 3 differential with full observable list/lock/diagnostic state and a killed mutation, real-header FFI layout tests, unchanged C assertions linked through narrow REAL private list/lock adapters (SOURCE_AUDIO_CAPTURE_EXTERNAL), unchanged source-audio/volmeter OFF/ON and equal exported symbols. Build EVERY Linux *_rust target, run the whole native_build:: module and ci/windows_link_check.py; if Windows fails, run ci/cmocka_link_check.py --alias mac-arm64 separately. Prove the Darwin recorder binding if the Rust implementation calls a fake C dependency. No aborting adapter stubs or placeholders. No public-header, existing-C-test, WebSocket or workflow edits. Tier 4 is inapplicable to this non-protocol unit. Coordinate any S-group overlap, including #5228, before publication.

Prerequisite PR: #5242 (auto-merge armed on validated signed head 094e4aa). Wait for that C-only extraction to merge before the Rust swap. The prerequisite already passed 320 native_build tests, all 64 Linux *_rust builds, new/unchanged audio tests OFF/ON, 1,769-symbol parity, Windows and Darwin full Rust-static links and explicit new-fixture cross links, and full lint. The immutable fixture's sentinel callbacks differ observably so identical-code folding cannot collapse callback identities.

Activity

  1. added
    port
    ready
    P2
    size:S
    on Nov 19, 2026
  2. rdoupe commented on Nov 19, 2026

    @rdoupe
    Collaborator

    Claiming: port obs_source_add/remove_audio_capture_callback to obs-source.

    The C extraction (#5242) is on master. Plan: RED Tier 1 mirrors against a stub, then the safe-core GREEN with the Tier 3 differential against the original C, layout tests, and the unchanged cmocka fixture linked through narrow list/lock adapters.

  3. rdoupe commented on Nov 20, 2026

    @rdoupe
    Collaborator

    Done in #5254 (merged): obs-source-audio-capture-callbacks.c.h now builds only in its ported group and the entry points are Rust on master. The PR said Refs, so closing by hand.

  4. moved this from In progress to Done in obs-rust Multiviewon Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2portreadysize:S

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions