Repository navigation
obs-source: swap source audio-pause subscriptions to safe Rust (Refs #4375) - #5258
Merged
Merged
Conversation
Tier 1 mirrors test_source_audio_pause_callbacks.c on the core; Tier 3 compares its call trace with the original C bodies. The core is a stub, so every case fails. Builds on Zach Vorhies' port/4375-source-audio-pause branch. Co-Authored-By: Zach Vorhies <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
…, Refs #4375) obs_source_add_audio_pause_callback and obs_source_remove_audio_pause_callback move from libobs/obs-source-audio-pause-callbacks.c.h to obs-source. The original C moves to its own ported group. The signal handler and obs_source_get_signal_handler() stay where they are. Builds on Zach Vorhies' port/4375-source-audio-pause branch. Co-Authored-By: Zach Vorhies <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1795106347,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":95,"stamp":"5f8e3e223d40593080606d87f8f815ab","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106347,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":95,"stamp":"91df059559f826f54639f70b1287f5e5","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106347,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":95,"stamp":"bb9678de9a238a9438780988ae93a0c1","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106347,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":95,"stamp":"82136829518d787a934d30c092816d0d","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"general/all/client-lint","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"7978837f5096f39c4b5306a8290c4804","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106347,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":95,"stamp":"8bf2cfd1284ec81cb03181ea869e9b6c","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"e9dd82b0d20c755d22af090bea71bbe5","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"fd493dc1bad556e3d1e95d50e54f2628","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"4c33c2a521f01c1b64e78e2824580dde","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"b4781a7cf432e6aaafbf5bf4185c4aeb","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"ff2ff87b57419bc7e8b269a933b86fe8","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"f17ccbb012e2a7cc04cfbe781da9bb53","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"c55e1d345f2945af79deedbf481552cf","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"8724f9d8387bd13196cc865305a2baea","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"b25b4767d25fd34ccee65316ce0408d3","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"a54d0cc2b8591287e10401ede0018950","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"6885f506da313002c0275187b3bdfa1c","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106251,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"2362aa3cb8c651270286d2563fbeee0fc1fa792e2eef3c9a99900b1bd7cbab41","lane":"client-lint","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":61,"stamp":"0097c674098fca764bbb2042665a46f8","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Ci-Attestation: {"at":1795106562,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"9298ac90c25fddee0a04b1eaf5d3625c1cb9d436dd2bf2915a4b64cb562fbbb2","lane":"client-test-x86_64-unknown-linux-gnu","parents":["6dbbecb58d5579f0fc69c5674b7ca6dc8cd4b134"],"secs":214,"stamp":"c120c2fd7cdea12e0cad046452f68b6f","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98","v":1,"via":"run"} Client-Checks: {"checks":{"base":"9135554e3e5b9c608f75794f930709ea15dd2af8","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/build/libobs.ported-source-audio-pause-callbacks+.h.c","libobs/build/ported-source-sets/source-audio-pause-callbacks.json","libobs/cmake/rust-exports.d/obs-source-source_audio_pause_callbacks.txt","rust/README.md","rust/obs-c-oracle/oracle/source_audio_pause_callbacks.c","rust/obs-source/src/audio_pause_callbacks.rs","rust/obs-source/src/ffi/mod.rs","rust/obs-source/src/ffi/source_audio_pause_callbacks.rs","rust/obs-source/src/lib.rs","rust/obs-source/tests/source/audio_pause_callbacks.rs","rust/obs-source/tests/source/audio_pause_callbacks_parity.rs","rust/obs-source/tests/source/main.rs"],"head":"8d1d763483e68b80c2a3080eb3ec84705c077127","tools":{"orchestrator-python":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]","schema-dependencies":"3.13.16 (main, Oct 14 2026, 01:04:01) [Clang 23.1.3 ]\n{'jsonschema': '4.26.0', 'json_source_map': '1.0.5'}","uv":"uv 0.13.5 (x86_64-unknown-linux-gnu)","xmllint":"xmllint: using libxml version 21504-GITv2.15.4\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ICU ISO8859X Regexps Automata RelaxNG Schemas Schematron Modules Debug Zlib"},"tracked-digest":"1a97a65e0b99e2577cb368f59f99df6066b1eb8b0111c5fe67de11d64e049ead","tree":"8c5d086b4591b88c9b4b42e8efbf85df20520f98"}}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #4375
Moves
obs_source_add_audio_pause_callbackandobs_source_remove_audio_pause_callbackfromlibobs/obs-source-audio-pause-callbacks.c.hintoobs-source. The C extraction (#4380) is the prerequisite. This builds on Zach'sport/4375-source-audio-pausebranch from 2026-11-09 (co-authored), rebased onto current master with the README row filled in.What changed
obs-source::audio_pause_callbacks::update: a NULL source logs<name>: Null 'source' parameter(theobs_source_valid()text) and touches nothing; otherwise the signal handler is fetched once and the pair is connected to, or disconnected from,media_pausethenmedia_stopped, the C's order.obs-source::ffi::source_audio_pause_callbacks: the two public exports.obs_source_get_signal_handler(),signal_handler_connect/_disconnectandblogare called through their existing C ABI; nothing about the source layout is mirrored.libobs.core-sourceinto its own ported group,libobs.ported-source-audio-pause-callbacks. Its only in-tree caller (the macOS CoreAudio monitor) is unchanged.Tests
rust/obs-source/tests/source/audio_pause_callbacks.rsmirrors the two cmocka cases on the core, plus the fetch-once-then-pause-then-stopped order.test_source_audio_pause_callbacks.cis unchanged and linksOBS::libobs, so it now runs against the Rust exports in the hybrid libobs (and against the C reference).audio_pause_callbacks_parity.rscompares the core's ordered call trace with the original C bodies (rust/obs-c-oracle/oracle/source_audio_pause_callbacks.c, which records instead of connecting) over every NULL source / NULL callback / NULL param / add-or-remove combination and proptest sequences of up to 64 operations; the C recorder also checks the callback and param it was handed.Evidence
RED (6dbbecb, core stubbed):
GREEN:
🤖 Generated with Claude Code