Repository navigation
libobs: characterize and extract obs_save_sources_filtered and obs_save_sources (Refs #5564) - #5566
Merged
Merged
Conversation
…sources, not yet registered (Refs #5564) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…im (Refs #5564) Moves obs_save_sources_filtered(), the static save_source_filter() and obs_save_sources() unchanged from obs.c.h into obs-save-sources.c.h, a member of the core unity group, and registers test_save_sources in the canonical test graph so it runs against hybrid libobs and the C reference. Co-Authored-By: Claude Opus 5.5 <[email protected]> Ci-Attestation: {"at":1795503360,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":93,"stamp":"c063988138b574cd52484d013c9abbd3","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503360,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":93,"stamp":"1c9d90624566159813874b3ac9815fb9","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503360,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":93,"stamp":"e63d8a667553c58e50b68fd2475bdd74","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503360,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":93,"stamp":"5f3c981e56877afa0287ba2ac632fc59","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"general/all/client-lint","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"9344eb47b5b47fb11f84be530090ebdd","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503360,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":93,"stamp":"1cdaaf1a2667a8ae6d87f0f8c763ae2b","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"e8e9762dd5316dec211ec0e20ff77bda","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"b5d1950d124f3959e4a697c585f0e555","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"26f65209b0b0a6398b2a423d5bb274cd","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"a8d0f3b7e3090bbc77a42459a8fdd696","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"73a051bf824aa71f6777cdcce065ee28","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"a11fe66f1f33b3599efad401564a8d50","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"f74cb8e60925f1a866f1a8a0380a0ef5","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"cb78619eee036971b5c7ca4490eb1047","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"33848b3600e56b8a0d849c51f92f7f10","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"aeca5aaff660745fed768123c173e16f","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"ad7e58f10fe9c0aabf778b8886c70115","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503266,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"47d311b24a3d811e40bbeb5fad2934e54a55b103715d1af8435e56d1ff5a1085","lane":"client-lint","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":11,"stamp":"47d48cb15c1e9e7fc33c38d37f7d6182","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Ci-Attestation: {"at":1795503608,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"3e69d4966083b2f99c916eca736a836ce9317f6f0325f323c5346d304e600b26","lane":"client-test-x86_64-unknown-linux-gnu","parents":["4d68dc68bff11212d56a365207e5d2be01f17e4a"],"secs":247,"stamp":"7a8f655997cb5c901fbee361ae9d6fbe","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e","v":1,"via":"run"} Client-Checks: {"checks":{"base":"b8c66a35f8f8eb9eade5750253ace32b4b33cef3","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core+.h.c","libobs/obs-save-sources.c.h","libobs/obs.c.h","test/cmocka/build/test-graph.json","test/cmocka/test_save_sources.c","test/cmocka/tests.d/test_save_sources.cmake"],"head":"01164ee1df708bcca197c345c06d8b54c48da82e","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":"8354f7750d32302112d58bd5081689ea0c096eab06c48519e2485b01ac896cae","tree":"a6ed50fbff4298b7cf8b1ddc16b16f66b232b99e"}}
This was referenced Nov 24, 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.
Adds a live-core C characterization of
obs_save_sources_filtered()andobs_save_sources(), the scene-collection save every frontend uses, then moves them verbatim fromlibobs/obs.c.hintolibobs/obs-save-sources.c.h, a member of the core unity group (libobs/build/libobs.core+.h.c, alphabetical):obs_save_sources_filtered(), the staticsave_source_filter()andobs_save_sources().test_save_sourcesis registered once in the canonical test graph with itstests.dmarker. No behavior change; existing C tests and public headers are unchanged.Refs #5564. This is the C-only prerequisite; the Rust swap is tracked separately.
What the test pins
Live core:
obs_startupplusobs_reset_videowith the OpenGL module, liketest_task_queue_entry_points; it skips without a display.obs_save_sources()saves every public input and scene in creation order, each entry equal toobs_save_source()of that source (name,uuid,id,versioned_id, and the whole entry's JSON);filtersarray), private inputs and scenes, hidden sources (obs_source_set_hidden; shown again, they are saved again in their place), sources afterobs_source_removewhile the caller still holds them, and sources whose last reference was released;obs_save_sources_filtered(cb, param)callscbonce per candidate, in creation order, withparamunchanged, never for an excluded source, and keeps exactly the sourcescbreturns true for (four keep masks, including none and all);Two things the public API cannot pin directly:
obs_source_create()always makes a filter private, so theinfo.type != OBS_SOURCE_TYPE_FILTERcondition is only observable together with the private check (see the mutation check below, where dropping the private check still leaves filters out).Evidence
4d68dc68b): adds the characterization without registering it, as in libobs: characterize and extract the task queue entry points (Refs #5560) #5561.git show 4d68dc68b:test/cmocka/build/test-graph.json | grep -c test_save_sourcesprints0, so the build has notest_save_sourcestarget.2cff0dd7d): registers the test and extracts the three functions. The new file's body after its 2-line header is lines 2045-2084 oforigin/master'sobs.c.h, byte for byte (diff <(git show origin/master:libobs/obs.c.h | sed -n '2045,2084p') <(tail -n +3 libobs/obs-save-sources.c.h)prints nothing).OBS_CTEST_JOBS=10 uv run rust/tools/linux-validate/run.py --repeat 3 --tests test_save_sources: full Linux Tier 2 passed against the C reference (100% tests passed, 0 tests failed out of 1094) and hybrid libobs (100% tests passed, 0 tests failed out of 1094), thentest_save_sourcespassed 3 repeats against each (100% tests passed, 0 tests failed out of 1, twice). It takes about 1.0 s.docker run --init,xvfb-run -a, in the ctest working directory):[ PASSED ] 5 test(s)against/build/tree/libobs/libobs.so.30and again withLD_LIBRARY_PATH=/build/tree/libobs-c-reference;lddconfirmed each library, and nothing was skipped.!source->context.private &&dropped fromobs_save_sources_filtered()and both libraries rebuilt in the kept volume, the binary failed against each:leaves_out_filters_private_hidden_removed_and_released(5 != 3: the private input and scene were saved; the filters stayed out through the type check),filtered_calls_back_per_candidate_and_keeps_trueandsave_keeps_refcount([ FAILED ] tests: 3 test(s), both libraries). After reverting, both passed 5 of 5 again../lintpassed.Not run locally: native Windows/macOS (the test is Linux/OpenGL only, like the other live-core graphics tests). Tier 1/3 and Tier 4 do not apply to a C-only extraction. No
docs/features.mdline: nothing a user can notice changes.🤖 Generated with Claude Code