Skip to content

libobs: characterize and extract obs_get_audio (Refs #4807) - #4809

Merged
vpacher merged 2 commits into
masterfrom
test/4807-get-audio
Nov 13, 2026
Merged

vpacher merged 2 commits into
masterfrom
test/4807-get-audio

Conversation

@zackees

@zackees zackees commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

obs_get_audio is characterized through its exported C API and its complete definition is extracted verbatim into libobs/obs-get-audio.c.h, registered alphabetically in the existing core unity group. Refs #4807. This C-only prerequisite preserves behavior and the public API; the separate Rust swap is #4810.

Characterization commit a2a61b19673ff1a9b36255b01e4efa29dbd449af precedes the extraction commit, preserving test-before-extraction history. Three portable cases cover absent output before setup and after disabling, repeated borrowed reads, stereo/mono and sample-rate reconfiguration, reopening, current output identity through core/direct callback registration, unchanged idle/active state and sink registration, and shutdown without releasing borrowed handles. Calls require an initialized core. The tests use no hardware input, sleeps or frame waits.

The original implementation session ran test_get_audio, unchanged test_raw_audio_remove, and unchanged test_object_ref five times per actual hybrid and C-reference library before and after extraction: 60 suite executions, zero failures. Loader paths matched the intended libraries and all 1,768 dynamic exports matched. A preload mutant returning null failed both populated cases with cmocka exit 2; restoring the getter passed. The extracted definition is byte-for-byte identical.

Rebased onto 9800296f87232b7c89478333bcc5666f6c21f1f7 after #4785, #4814 and #4818. The sole conflict was the core unity list: the resolution retains the current main-canvas fields include, scene enumeration and all other upstream entries, then inserts the audio getter in alphabetical order. git range-diff confirms the characterization patch is unchanged and only that context differs in the extraction patch. The characterization source, registration and extracted getter are byte-for-byte unchanged from previous head c9285ad1aa87e0f2213cff0cf31b898780984be8.

Rebase validation: soldr cargo fmt --all --check passed; all 275 selected obs-tests-app native_build:: tests passed; SOLDR_PORCELAIN=0 ./lint passed in 133.6 s with rc=$? captured directly as 0. Test-graph ordering and git diff --check passed.

Focused Tier 2 replay rebuilt the actual hybrid and C-reference libraries using the repository Docker harness, with only its build target list and CTest selector narrowed in a scratch script. test_get_audio, unchanged test_raw_audio_remove, and unchanged test_object_ref each passed once against each backend: six suite executions, zero failures. Loader paths matched each intended library, and all 1,768 dynamic exports matched.

Rust safe Tier 1 and original-C differential Tier 3 belong to the separate swap. Tier 4 does not apply. Existing C tests, public headers, WebSocket and workflows are unchanged. No user-visible behavior change requires a features-ledger entry. Full Tier 2 and native Windows/macOS runtime remain subject to hosted validation.

Publication: ./push replaced c9285ad1aa87e0f2213cff0cf31b898780984be8 with 911be0ad27f79af6aba41b6d23af8afb43976e9b using an explicit force-with-lease pinned to the previous head. The current push script ignores arguments, so a temporary Git wrapper appends the exact lease only to this branch push. Complete client proof stopped at the arm64 Dylint lane because soldr has no pre-deployed driver for the selected nightly; no complete client evidence was stamped, and ordinary hosted PR CI remains required. The requested local lint and focused validation passed independently.

@zackees zackees changed the title refactor(libobs): extract obs_get_audio verbatim (Refs #4807) libobs: characterize and extract obs_get_audio (Refs #4807) Nov 13, 2026
@zackees
zackees force-pushed the test/4807-get-audio branch from 9d2a579 to c9285ad Compare November 13, 2026 05:53
@zackees
zackees marked this pull request as ready for review November 13, 2026 05:54
@zackees
zackees enabled auto-merge November 13, 2026 05:54
@zackees
zackees force-pushed the test/4807-get-audio branch from c9285ad to 911be0a Compare November 13, 2026 07:24
@zackees

zackees commented Nov 13, 2026

Copy link
Copy Markdown
Member Author

Rebased onto 9800296f87232b7c89478333bcc5666f6c21f1f7, replacing head c9285ad1aa87e0f2213cff0cf31b898780984be8 with 911be0ad27f79af6aba41b6d23af8afb43976e9b via ./push and an explicit pinned force-with-lease. The characterization then extraction order is preserved. The single unity-list conflict keeps the current main-canvas fields include plus the audio getter in sorted order.

Validation passed: formatting; 275 native-build tests; focused get-audio/raw-audio-remove/object-ref suites against both actual libraries (six suites); identical 1,768 exports; test-graph sorting; diff whitespace; full ./lint (133.6 s, direct rc=0). Complete client proof could not finish the arm64 Dylint driver lane, so ordinary hosted PR CI remains required. Auto-merge is armed for the exact new head. closingIssuesReferences is empty and the body uses only Refs #4807. The stacked swap #4810 is left untouched while this prerequisite is unmerged.

@zackees
zackees added this pull request to the merge queue Nov 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 13, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this from In review to Ready to merge in obs-rust Multiview Nov 13, 2026
@vpacher
vpacher added this pull request to the merge queue Nov 13, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 13, 2026
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Ready to merge to Needs fix in obs-rust Multiview Nov 13, 2026
@vpacher
vpacher force-pushed the test/4807-get-audio branch from 911be0a to 1b2c25e Compare November 13, 2026 22:19
@vpacher

vpacher commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Coordinator: rebased onto master 22e2b7132 to clear the conflict that took this PR out of the merge queue after #4804 landed. The only conflict was the include list in libobs/build/libobs.core+.h.c: #4804 renamed obs-enum-scenes.c.h to obs-enum-scenes-fields.c.h, and this PR adds obs-get-audio.c.h. Both lines are kept. The RED and GREEN commits are otherwise unchanged (git diff origin/master HEAD --stat lists only the PR's own 5 files). The coordinator re-queues it when CI is green.

@vpacher vpacher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coordinator review at 1b2c25e (after my rebase onto master).

  • Correctness: the extraction is verbatim. obs_get_audio moves from libobs/obs.c.h to libobs/obs-get-audio.c.h with the same body, and the new file is in the core unity group in alphabetical order (BUILD.md: the PCH include is the file's only include).
  • Order: the characterization commit (f799e80) comes before the extraction commit (1b2c25e), as coordination.md asks for a C-only extraction. The Rust swap with Tier 1 and the Tier 3 differential is #4810, so this PR does not need them.
  • Tests: test_get_audio is a new cmocka test with three cases: no audio before setup and after disable, the borrowed output tracking reset, mono and stereo and rate changes, and an active output that stays unchanged. No existing C test or public header changes.
  • Features ledger: no user-visible change, so no line is needed.

Queued once hosted CI on this head is green.

@vpacher
vpacher added this pull request to the merge queue Nov 13, 2026
Merged via the queue into master with commit a84d43b Nov 13, 2026
40 checks passed
@vpacher
vpacher deleted the test/4807-get-audio branch November 13, 2026 23:30
@obs-rust-project-manager obs-rust-project-manager Bot moved this from Needs fix to Done in obs-rust Multiview Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants