Repository navigation
obs-source: port obs_source_get_width and obs_source_get_height to Rust (Refs #5726) - #5727
Merged
Merged
Conversation
This was referenced Nov 25, 2026
zackees
force-pushed
the
port-5726-source-size
branch
from
November 26, 2026 10:42
835f317 to
cb67400
Compare
zackees
force-pushed
the
port-5726-source-size
branch
from
December 3, 2026 23:40
cb67400 to
0592d58
Compare
zackees
marked this pull request as ready for review
December 3, 2026 23:40
zackees
enabled auto-merge
December 3, 2026 23:40
…im (Refs #5726) Move the two bodies, with size_start(), get_recurse_width() and get_recurse_height() (used only by them), unchanged out of obs-source.c.h into obs-source-get-size.c.h, still compiled in the live core-source group. data_valid() is static inline in obs-source.c.h; the extracted file keeps its one-line body as obs_source_get_size_data_valid() and maps the original name onto it with a scoped macro, so the bodies stay verbatim and the file also builds in a translation unit of its own. No Rust, no behavior change. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…efs #5726) Tier 1 cases in the existing obs-tests-core binary (rust/obs-source/tests/source/get_size.rs) on a model of what obs-source::get_size's Libobs trait reaches: sources with or without context.data, a type, a filter list, a base width and height, and the filter_mutex lock and unlock, recorded in call order. They pin NULL (one log naming the call, 0), no data (0, silent), a filter (its own base, no lock), and any other type (lock, first filter if any, its base, unlock). They run against a todo!() core: test result: FAILED. 1 passed; 7 failed panicked at rust/obs-source/src/get_size.rs:75:5: not yet implemented: #5726 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…st (Fixes #5726) - Safe core obs-source::get_size::get over a Libobs trait: a NULL source logs one LOG_DEBUG line naming the call and answers 0; no context.data answers 0 silently; a filter answers its own base size without a lock; any other source takes its filter_mutex, starts at its first filter when it has one (size_route::entry()), reads that base size and unlocks. - C ABI shims in ffi/source_get_size.rs; the fields and the mutex through the new libobs/obs-source-get-size-fields.c.h (live core-source group, no EXPORT); the base size through obs_source_base_width()/_height(). - The extracted file moves to the reference-only group libobs.ported-source-get-size (+ ported-source-sets JSON); both names are EXPORT in obs.h, so they go into rust-exports.d/obs-source-source_get_size.txt. - Oracle: oracle.d/source-get-size.list and oracle/source_get_size.c (the original C renamed oracle_*, the production adapters, error-checking filter mutexes, recording size callbacks). - Tier 3 get_size_parity.rs: which node answered, on which axis, with which mutexes held, the result, the log lines and every mutex free afterwards, over a grid, a proptest and pinned answers; six shim mutants rejected. Excluded input: a NULL filter-list entry, never stored by obs_source_filter_add(). - Tier 1 model's first_filter now returns Option, as the trait does. - obs-build registration test and a rust/README.md row. Tier 2: the existing cmocka tests reaching these exports run unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Client-Checks: {"checks":{"base":"152c528e41cbfc33e0a17189d18f7ca81191937b","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/build/libobs.ported-source-get-size+.h.c","libobs/build/ported-source-sets/source-get-size.json","libobs/cmake/rust-exports.d/obs-source-source_get_size.txt","libobs/obs-source-get-size-fields.c.h","libobs/obs-source-get-size.c.h","libobs/obs-source.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_source_get_size_swap_is_registered.rs","rust/obs-c-oracle/oracle.d/source-get-size.list","rust/obs-c-oracle/oracle/source_get_size.c","rust/obs-source/src/ffi/mod.rs","rust/obs-source/src/ffi/source_get_size.rs","rust/obs-source/src/get_size.rs","rust/obs-source/src/lib.rs","rust/obs-source/tests/source/get_size.rs","rust/obs-source/tests/source/get_size_parity.rs","rust/obs-source/tests/source/main.rs"],"head":"0f510644b7f7adb7154da31a8bffff2d81633924","tools":{"orchestrator-python":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.1.3 ]","schema-dependencies":"3.13.15 (main, Aug 14 2026, 15:34:59) [Clang 22.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 21503\n compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 DTDValid HTML C14N Catalog XPath XPointer XInclude Iconv ISO8859X Regexps Automata RelaxNG Schemas Modules Debug"},"tracked-digest":"99b00f09d2939a640db2f97ba04a823b6201211b9f43a51c2481bab079729e7b","tree":"15e9e0a0b729fc2d13783c4b3cc76ddab9a26942"}} Ci-Attestation: {"at":1795689338,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5d8c7b19c35b9f9c2eac286a4e68d3814f4b60fc"],"secs":118,"stamp":"d011b7a2f12556261322d68788a35a1b","tree":"15e9e0a0b729fc2d13783c4b3cc76ddab9a26942","v":1,"via":"run"} Ci-Attestation: {"at":1795689338,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5d8c7b19c35b9f9c2eac286a4e68d3814f4b60fc"],"secs":118,"stamp":"c3c6fc2f1c233442605116450acbf473","tree":"15e9e0a0b729fc2d13783c4b3cc76ddab9a26942","v":1,"via":"run"} Ci-Attestation: {"at":1795689338,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5d8c7b19c35b9f9c2eac286a4e68d3814f4b60fc"],"secs":118,"stamp":"cfbe46213d3c820b77ef8bdee49d1490","tree":"15e9e0a0b729fc2d13783c4b3cc76ddab9a26942","v":1,"via":"run"} Ci-Attestation: {"at":1795689338,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5d8c7b19c35b9f9c2eac286a4e68d3814f4b60fc"],"secs":118,"stamp":"3042cef0f942e891b98ba2374d5b129b","tree":"15e9e0a0b729fc2d13783c4b3cc76ddab9a26942","v":1,"via":"run"} Ci-Attestation: {"at":1796369638,"gate":"general/all/client-lint","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"aa39b7a10a9e1c3b7fcad08da4fb1b52","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1795689338,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["5d8c7b19c35b9f9c2eac286a4e68d3814f4b60fc"],"secs":118,"stamp":"f44c740e2fa5c3d9a1b4084918b8fc4a","tree":"15e9e0a0b729fc2d13783c4b3cc76ddab9a26942","v":1,"via":"run"} Ci-Attestation: {"at":1796369639,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"8b0125864b8c9cc1b27eb67da10cf09e","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369639,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"d719a8a42482c703ca6e2b2d5bcadda0","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369639,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"e2f6c8a05fee69847bc21b5a06bb6b6b","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369639,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"b2949d914abe889b5d22c905d1f9a17f","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369638,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"92a4e7118d9a796254bb06f915deaef3","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369638,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"eb96c5011d62ee4c8a1cd56ef7121f69","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369639,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"f26a51d528e9f7c9df57c4961901a477","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369639,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"93f0a1a2d7d4674c84e080497a1d9363","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369638,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"da1e340286c818896e9f974c17acdb15","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369639,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"84db6173b26217e839cff43c67c1d930","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369638,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"55aaf541947414af2aac22954a88f024","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1796369638,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"1c7423dfa392339f70ad82f0896cffb6d70361cf0564c55ee2dc721b6fba80a1","lane":"client-lint","parents":["2f4f9b67cb0620d13b8210e998ee9eed9663dc5f"],"secs":242,"stamp":"be9722396000e7422a2c44ff911e84dd","tree":"96df878b76450f84a2652ff433126884b414fd66","v":1,"via":"run"} Ci-Attestation: {"at":1795689758,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"1f4abf5b7c0df140683dacb679737e61be05eac2130b0e7b510a1c001ee17117","lane":"client-test-x86_64-unknown-linux-gnu","parents":["5d8c7b19c35b9f9c2eac286a4e68d3814f4b60fc"],"secs":418,"stamp":"7cf9e86993418aa62e56f7a218e6b6bb","tree":"15e9e0a0b729fc2d13783c4b3cc76ddab9a26942","v":1,"via":"run"}
zackees
force-pushed
the
port-5726-source-size
branch
from
December 4, 2026 07:34
0592d58 to
5156c30
Compare
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 #5726.
Ports
obs_source_get_width()andobs_source_get_height()fromlibobs/obs-source.c.htoobs-source, following #5633.Commits (RED then GREEN):
size_start(),get_recurse_width(),get_recurse_height()move unchanged intolibobs/obs-source-get-size.c.h(livecore-sourcegroup).data_valid()is static in obs-source.c.h, so the file keeps its one-line body under its own name behind a scoped macro.obs-tests-core(rust/obs-source/tests/source/get_size.rs) againsttodo!():1 passed; 7 failed ... not yet implemented: #5726.obs-source::get_size, C ABI shimsffi::source_get_size, field/lock adapterobs-source-get-size-fields.c.h(no EXPORT), reference-only grouplibobs.ported-source-get-size, rust-exports list, oracle (oracle/source_get_size.c), Tier 3get_size_parity.rs(grid + proptest + pinned answers, six mutants rejected), obs-build registration test, README row.Behavior kept: NULL logs one
LOG_DEBUG<fn>: Null 'source' parameterand answers 0; nocontext.dataanswers 0 silently; a filter answers its own base size without a lock; any other source locksfilter_mutex, starts at its first filter if it has one, reads that base size and unlocks.Tier 2: no new or changed C tests; the existing tests reaching these exports (test_filter_size_no_target, test_async_rotation_normalize, test_group_empty_bounds, ...) run unchanged. No public header changes. One documented excluded input: a NULL filter-list entry (never stored by
obs_source_filter_add(); the C dereferences it, the Rust answers 0).Local evidence:
soldr cargo test -p obs-data --test obs-tests-core -- get_size10 passed;obs-tests-app -- canonical_source_get_sizepassed; full./lintpassed (228 s). Tier 2 C build not run locally.Ordering: overlaps #5724 (obs_source_get_color_space, adjacent lines) only in append-only registration lines (
core-source+.h.c,native.rs,ffi/mod.rs,lib.rs,tests/source/main.rs);obs-source.c.hmerges cleanly. Whoever lands second rebases. No test-graph.json change.Draft and unarmed: back pressure closed at publish (head 835f317).
🤖 Generated with Claude Code