Repository navigation
libobs: characterize and extract obs_add_raw_audio_callback (Refs #5502) - #5505
Merged
Merged
Conversation
Adds test_raw_audio_add, run against hybrid libobs and libobs-c-reference through the public API: registration on every mix of the core's main audio output, a repeated add kept once, callback and param identity, a conversion accepted, out-of-range and wide mix indices ignored, nothing kept when the core has no audio, and a new add going to a replaced main output. Registration is observed through audio_output_connect's duplicate rejection, without frame waits. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Moves obs_add_raw_audio_callback verbatim from obs.c.h into obs-raw-audio-add.c.h, a member of the core unity group (alphabetical, after obs-object-ref-fields.c.h), ahead of its Rust swap. No behavior change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1795427566,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"59d601b649147b6309e8c7ed5ecc228e","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427566,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"2022c34221a27e17afba58e2e320cb08","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427566,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"224d46e62240ea907b6594c5518150e0","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427566,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"245be87c21a870a29508cc52142f40ab","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"general/all/client-lint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"6720617e98431293629dccb101f711e3","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427566,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":94,"stamp":"d4304c34a6cd4def445ddf19a8773643","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"1674df05fceb5da70b9402f71764e4c4","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"42684c2a9ae8c5cccaab1ade25d51941","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"4e34e02b2bb16413c1827a7b976b8524","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"af5154929d138e8789d323614eae2368","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"9eb6ae0abd532f64420218a2b608e36e","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"7df5335dd0df7862b4ca37efe0000fa1","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"fb0d0ded6cf368b06e3e9617cb640b54","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"46c720700102538b883ccb53c713dd8a","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"72964fe1197d48ef9cfa1bde5323fe27","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"e1b2e6f14d121eb9ebf54ccb292f940b","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"5893a5c91a087e3aa117898a53d4c4d6","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427471,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"9406de7183c9f89a46948afd83e74cc9d3777dea2bd282aa72079dede27e85f4","lane":"client-lint","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":105,"stamp":"f1ec628b8b713d50972d9748a04a9f48","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Ci-Attestation: {"at":1795427776,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"995be26af5f1171ef0f6a8af0b5b5e1d4d8124780350ca78564a7dab29e34865","lane":"client-test-x86_64-unknown-linux-gnu","parents":["c913138dc59a754c54dc13742d99a22cc9f208b6"],"secs":209,"stamp":"77c6af0d053962d1a85135037dc6b61d","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2","v":1,"via":"run"} Client-Checks: {"checks":{"base":"5554cacff3927c616d3ee4de4ed79652c54d6855","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core+.h.c","libobs/obs-raw-audio-add.c.h","libobs/obs.c.h","test/cmocka/build/test-graph.json","test/cmocka/test_raw_audio_add.c","test/cmocka/tests.d/test_raw_audio_add.cmake"],"head":"8ec56c4dea1e98dd0890809c70a262a74593633c","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":"d710ac1ced9ec59395fbd9757096c7a712bf6272f5ce63cb9247f827bc6bbb58","tree":"0c2b4de80f70f72673d493f9c34416215b62c0c2"}}
This was referenced Nov 23, 2026
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 #5502
C-only prerequisite for the Rust swap of
obs_add_raw_audio_callback(Phase 6, #444), the counterpart ofobs_remove_raw_audio_callback(#4727, then #5003). Two commits:test_raw_audio_addcmocka test (it had none of its own), through the public API. It pins: an add registers on every mix of the core's main audio output; a repeated add is kept once (one removal takes it out); callback and param are both part of the identity; a conversion is accepted; out-of-range mixes (MAX_AUDIO_MIXES,SIZE_MAX, and on 64-bit hostsUINT32_MAX + 1and+ 2, which would alias mixes 0 and 1 if narrowed) register nothing; with no audio set up the add does nothing and nothing is kept for later; an output the core does not own is left alone, and after the core's audio is replaced a new add goes to the new output. Registration is observed throughaudio_output_connect's duplicate rejection, with no frame waits (Flaky Tier 2: test_source_transition_slots clear_empties_both_slots child_alive under load #4680). No display needed.obs.c.hintoobs-raw-audio-add.c.h, registered alphabetically in the core unity group. No behavior change.No existing C test or public header changes.
Evidence
This characterizes unchanged behavior, so there is no RED commit: the test passes on master's code and must keep passing after the move.
OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 1 --tests test_raw_audio_addpassed againstlibobs-c-reference([OFF]) and hybrid libobs ([ON]):100% tests passed, 0 tests failed out of 1088in each full run, andtest_raw_audio_add ... Passedin each filtered repeat.if (1) return;at the top), the same command failstest_raw_audio_addonlibobs-c-reference. The log shows all 7 cases ran:every_mix_registers,repeated_add_is_one_registration,callback_and_parameter_identity,conversion_is_acceptedandconnects_to_main_audioFAILED;initialized_core_without_audioandinvalid_full_size_mixpassed, as they should when nothing registers. (The run stops after the first library's failures; 19 other tests that use the add also failed.)./lint: ok.🤖 Generated with Claude Code