Repository navigation
obs-source: port obs_source_video_tick to Rust (Fixes #5964) - #5968
Conversation
|
Coordinator fixup |
zackees
left a comment
There was a problem hiding this comment.
Coordinator review: LGTM with the fixup above.
- Shape: the usual port, with a new Tier 2
test_source_video_tick_entry.c, Tier 3video_tick_entry_parity.rsagainst the oracle, and a Test cost line. - Export:
obs_source_video_tickis declared inobs-internal.h, not inobs.h, so therust-hidden.dfragment is right. - Rules: no existing C test or public header edited.
- Windows (#5919): no
util_mul_div64and no wideusizeinputs. - Status: auto-merge on.
Move obs_source_video_tick() (declared in obs-internal.h, no EXPORT) unchanged out of obs-source.c.h into obs-source-video-tick-entry.c.h (live group libobs.core-source), with the declarations of the two steps obs-source.c.h declared for it, process_media_actions() and async_tick(), and the static checks of the type and flags it asks about. No behavior change. The registration tests of the async tick and the tick callback steps now find their caller in the new file. The new cmocka test_source_video_tick_entry characterizes what only the shell does, through the real libobs on the video thread (the function is hidden), with a tick callback marking where each tick begins: the plugin's video_tick once a tick with the source's data and the tick's seconds; no video_tick for a source without data; async_rendered and deinterlace_rendered cleared after the plugin's callback (it always finds them false, and no tick begins with them set); a show callback that raises the activate count activating the source in the same tick (and a hide callback that drops it deactivating it), before the plugin's callback; and filter_texrender reset once a tick, so a texrender the callback rendered into is free again in the next tick. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The safe core's Host trait (the validity check, info.type, obs_transition_tick(), info.output_flags, async_tick(), process_media_actions(), defer_update_count and obs_source_deferred_update(), filter_texrender and gs_texrender_reset(), show_refs, showing, activate_refs, active and their stores, the show, hide, activate and deactivate steps, filters.num and each entry, context.data, info.video_tick and the plugin's call, async_rendered and deinterlace_rendered) and todo!() steps, with 18 Tier 1 tests over a recording model whose hooks change the source from inside a call: NULL returns after the check; a plain source reads every field once in order; a transition ticks with the seconds (only that type); the output flags read again after async_tick() (the media step follows the new flags, either way); the media step alone; a deferred update for a count above 0; the texrender reset only when set; show, hide, activate and deactivate edges on the source then its filters from last to first, then the flag stored; the activate count loaded only after the show edge (a show callback raising it activates in the same tick, a hide callback dropping it deactivates); the filter count read after the source's own step; no edge, no filter read; a negative count shows and activates; the plugin's tick only with data and a callback; the two rendered flags cleared last, after the plugin's callback; every step together; and one edge alone. All 18 fail on the todo!() core. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The safe core in obs-source::video_tick_entry, the hidden export
obs_source_video_tick() in obs-source::ffi::source_video_tick_entry
(rust-hidden.d; obs-internal.h declares it without EXPORT), one-access
adapters in libobs/obs-source-video-tick-entry-fields.c.h (live group
libobs.core-source), and the original moved to the reference-only group
libobs.ported-source-video-tick-entry. Every decision is
obs-source::video_tick; the validity check, the fields, the three counts
and every step it dispatches to (obs_transition_tick(), async_tick(),
process_media_actions(), obs_source_deferred_update(),
gs_texrender_reset(), the show, hide, activate and deactivate steps and the
plugin's video_tick) stay C. The output flags are read again after
async_tick(), the activate count is loaded only after the show edge ran,
the filters are walked from last to first with filters.num read after the
source's own step, and async_rendered and deinterlace_rendered are cleared
last.
Tier 3 in obs-c-oracle (oracle/source_video_tick_entry.c) runs the
original C, with the oracle's original decisions, against the Rust export
on real-layout sources with up to six filters, over shared stand-ins of
the check and every step. Clobbers rewrite the output flags after
async_tick(), flip the activate count from the show and hide steps, drop a
filter from the source's own step, flip filter_texrender from the deferred
update, set the rendered flags from the plugin's callback, clear
context.data from the activate steps, raise the defer and show counts from
the media and transition steps and flip each step's own flag. It compares
the log, the fields, the filters' flags and every other byte over a grid
and a proptest, pins the order from the C's log, and rejects nine
mutants. No intentional differences.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ci-Attestation: {"at":1795991720,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":76,"stamp":"b17d50d24e42298b32203b8060a1c597","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991720,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":76,"stamp":"f04011495b69b9cd12a2224e3fab5143","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991720,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":76,"stamp":"e52ade27ba3b3006a89ef396e7f78a4c","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991720,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":76,"stamp":"b1aed3b4ff82bb38817351238ff9db5d","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"general/all/client-lint","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"cf46434ca14c3cc01df5963ae5842f85","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991720,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":76,"stamp":"17b3f58d856385d41657b8f6f06c6920","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"d4f43a071b67f61c0913e458d6ae1873","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"9e1809da8c349799a687d7f80de1bf13","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"fdc9599ac8a4e88fdfa91abc5d83db1d","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"81cf1df923835155988de528de107d1f","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"cb53c2bfa28694fbee2f4a064702a1bf","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"dc2ab9d83662a17af4bdb49533329d55","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"ec0b3da0776bc43669ab3f3eb5593d53","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"69103b67fe203293287816dad871ae25","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"8d5ad108f567eb74ee3cd9beb11a2777","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"5da9ccc6975546dda5f5d2aeb7eea297","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"fcfee6fe66fa7c7f086f65a8f026f727","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795991643,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"913bd5de1723ef58001e4d7601f88bde4300b4eabd4f9d58777ffdb5671aa382","lane":"client-lint","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":100,"stamp":"2231a406631306820c619e4b0b1dbe92","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Ci-Attestation: {"at":1795992070,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"4e8d4e663fc12df16fd09e8576bfb38d990a02a3a26d5791d2ef8285c1fa576b","lane":"client-test-x86_64-unknown-linux-gnu","parents":["37e4f36f9730a1b01a976b90e4f1498c66ebda84"],"secs":350,"stamp":"290c1e15297beb193e6f4c31a96ae63c","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf","v":1,"via":"run"}
Client-Checks: {"checks":{"base":"33c2d863895425d0ef067a4956eafe793943ae61","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/build/libobs.ported-source-video-tick-entry+.h.c","libobs/build/ported-source-sets/source-video-tick-entry.json","libobs/cmake/rust-hidden.d/obs-source-source_video_tick_entry.txt","libobs/obs-source-video-tick-entry-fields.c.h","libobs/obs-source-video-tick-entry.c.h","libobs/obs-source.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_source_async_tick_swap_is_registered.rs","rust/obs-build/tests/native/registration/canonical_source_video_tick_callbacks_swap_is_registered.rs","rust/obs-build/tests/native/registration/canonical_source_video_tick_entry_swap_is_registered.rs","rust/obs-c-oracle/oracle.d/source-video-tick-entry.list","rust/obs-c-oracle/oracle/source_video_tick_entry.c","rust/obs-source/src/ffi/mod.rs","rust/obs-source/src/ffi/source_video_tick_entry.rs","rust/obs-source/src/lib.rs","rust/obs-source/src/video_tick_entry.rs","rust/obs-source/tests/source/main.rs","rust/obs-source/tests/source/video_tick_entry.rs","rust/obs-source/tests/source/video_tick_entry_parity.rs","test/cmocka/build/test-graph.json","test/cmocka/test_source_video_tick_entry.c","test/cmocka/tests.d/test_source_video_tick_entry.cmake"],"head":"37bdbafa5d9c2b9082b4b633ad0858b5e8e35baa","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":"af89e26894d0782bbc70ba346b4bc2e2d96031875e7f8e040c6215f6adeb13b8","tree":"f56ae1f9fff2bc75aa0d40b36bf90217c4f28fbf"}}
macOS clang builds the oracle with -Werror,-Wdouble-promotion, so the
implicit float to double in vte_transition_tick and vte_plugin_tick failed
Rust Cross Lint (aarch64-apple-darwin) and macOS Rust Artifacts (run
46319186769). Same value, explicit cast.
Ci-Attestation: {"at":1795993815,"gate":"data/all/compatibility","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":77,"stamp":"f8e546f933460c8970e09e79e9f532ce","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993815,"gate":"data/all/flatpak-manifest","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":77,"stamp":"9f4073b019c9ce4b043418566e710d6a","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993815,"gate":"data/all/qt-xml","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":77,"stamp":"3d5b3df885b38ac0e2ff00bf7580c9d3","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993815,"gate":"data/all/services-schema","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":77,"stamp":"450bdd5fe58db91a881d9a4e90ab2c58","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"general/all/client-lint","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"acb957f308692f9685696fd38a7cfdc0","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993815,"gate":"python/all/self-test","host":"linux-x86_64","key":"","lane":"client-checks","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":77,"stamp":"bbcc400e536c06031c85702e93a38e54","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/aarch64-apple-darwin/client-clippy","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"43863ef93e58c22e3a45c13493a83ac8","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/aarch64-apple-darwin/client-dylint","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"937074b812a4d9f7fdc1a7f25376b3e7","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/aarch64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"96e852ba8b5781bcc868f7907a926edb","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/aarch64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"6d275a2421230cdd1dacae948240c621","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/aarch64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"0ae460e4a88bc446506042b135e47b82","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/aarch64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"aee5061ef2e86e6191b21a42aaca7791","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/x86_64-apple-darwin/client-clippy","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"7dccad8a7ea514abec4e4210200f9f5a","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/x86_64-apple-darwin/client-dylint","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"4265510914932a0fa121762e70ececd2","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/x86_64-pc-windows-msvc/client-clippy","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"4d1d8b3ea9f5f9d08755e320339ea950","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/x86_64-pc-windows-msvc/client-dylint","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"e4999a104a1cf439be0e597bd40c167c","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/x86_64-unknown-linux-gnu/client-clippy","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"5713773e8a0b4e225673c19fb5ef3903","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795993737,"gate":"rust/x86_64-unknown-linux-gnu/client-dylint","host":"linux-x86_64","key":"184a1bf604a3373e94961f0237b494ace9c54266f89bef464be865b495b08e85","lane":"client-lint","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":144,"stamp":"0c87b61c7254b1e8adb0d4eeed4008df","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Ci-Attestation: {"at":1795994148,"gate":"rust/x86_64-unknown-linux-gnu/client-test","host":"linux-x86_64","key":"f912e37318d2d322b838c0c8242aa8d2347349b4b9459c62732d747f7511e582","lane":"client-test-x86_64-unknown-linux-gnu","parents":["cf61d1ae9e7ec532bf4391e68cee5ecf9750989d"],"secs":333,"stamp":"86e14f0b283046fe75eea03ea8cbe8a5","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d","v":1,"via":"run"}
Client-Checks: {"checks":{"base":"130e6019e5285d128eba2dd55fff87f44c62460f","coverage":"all-tracked-applicable-files","diff":["libobs/build/libobs.core-source+.h.c","libobs/build/libobs.ported-source-video-tick-entry+.h.c","libobs/build/ported-source-sets/source-video-tick-entry.json","libobs/cmake/rust-hidden.d/obs-source-source_video_tick_entry.txt","libobs/obs-source-video-tick-entry-fields.c.h","libobs/obs-source-video-tick-entry.c.h","libobs/obs-source.c.h","rust/README.md","rust/obs-build/tests/native.rs","rust/obs-build/tests/native/registration/canonical_source_async_tick_swap_is_registered.rs","rust/obs-build/tests/native/registration/canonical_source_video_tick_callbacks_swap_is_registered.rs","rust/obs-build/tests/native/registration/canonical_source_video_tick_entry_swap_is_registered.rs","rust/obs-c-oracle/oracle.d/source-video-tick-entry.list","rust/obs-c-oracle/oracle/source_video_tick_entry.c","rust/obs-source/src/ffi/mod.rs","rust/obs-source/src/ffi/source_video_tick_entry.rs","rust/obs-source/src/lib.rs","rust/obs-source/src/video_tick_entry.rs","rust/obs-source/tests/source/main.rs","rust/obs-source/tests/source/video_tick_entry.rs","rust/obs-source/tests/source/video_tick_entry_parity.rs","test/cmocka/build/test-graph.json","test/cmocka/test_source_video_tick_entry.c","test/cmocka/tests.d/test_source_video_tick_entry.cmake"],"head":"e95eb388e5f58c651733b09d7c1c1a31c849b3cf","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":"5f5dcb77f85b065cae72e0fc8bc962a6a5fc72f61edfc926a516a5504fe1bdf5","tree":"751d6ef90a4a76851c66bc6861c893f9ab59886d"}}
8c185fb to
6338109
Compare
|
Note on the body: the Evidence numbers were taken before I rebased onto master after #5963 merged. The rebase had one conflict, in |
Fixes #5964.
This ports
obs_source_video_tick()toobs-source, in the shape of #5930, #5954 and #5963. It is what the video thread runs once a frame for every source: the transition tick, the async tick, the media actions, a deferred update, the filter texrender reset, the show/hide and activate/deactivate edges, the plugin'svideo_tickand the per-tick resets. Every decision was already Rust (obs-source::video_tick) and every step it dispatches to was already split out; what moves now is the shell: the field reads in their order and the dispatch.What changes
libobs: extract obs_source_video_tick verbatim). The function moves unchanged intolibobs/obs-source-video-tick-entry.c.h(live grouplibobs.core-source), with the declarations ofprocess_media_actions()andasync_tick()and the static checks of the type and flags it asks about. The registration tests of the async tick and the tick callback steps now find their caller in the new file. The new cmockatest_source_video_tick_entrycharacterizes what only the shell does, through the real libobs on the video thread (the function is hidden), with a tick callback marking where each tick begins: the plugin'svideo_tickonce a tick with the source's data and the tick's seconds; none for a source without data;async_renderedanddeinterlace_renderedcleared after the plugin's callback; a show callback that raises the activate count activating the source in the same tick (and a hide callback that drops it deactivating it), before the plugin's callback; andfilter_texrenderreset once a tick.Hosttrait andtodo!()steps, with 18 Tier 1 tests over a recording model whose hooks change the source from inside a call, so a field read once too often, too early or too late shows.obs-source::video_tick_entry, the hidden export inobs-source::ffi::source_video_tick_entry(rust-hidden.d:obs-internal.hdeclares it withoutEXPORT), one-access adapters inlibobs/obs-source-video-tick-entry-fields.c.h, and the original moved to the reference-only grouplibobs.ported-source-video-tick-entry. Tier 3 inobs-c-oracle(oracle/source_video_tick_entry.c) runs the original C, with the oracle's original decisions, against the Rust export on real-layout sources with up to six filters over shared stand-ins of the check and every step. Clobbers rewrite the output flags afterasync_tick(), flip the activate count from the show and hide steps, drop a filter from the source's own step, flipfilter_texrenderfrom the deferred update, set the rendered flags from the plugin's callback, clearcontext.datafrom the activate steps, raise the defer and show counts from the media and transition steps, and flip each step's own flag. It compares the log, the fields, the filters' flags and every other byte over a grid and a proptest, pins the order from the C's log, and rejects nine mutants.Pinned in Tier 1 and Tier 3:
info.output_flagsis read again afterasync_tick()(the_output_flags_are_read_again_after_async_tick; theFlagsReadOncemutant).activate_refsis loaded only after the show edge (the_activate_count_is_loaded_after_the_show_edge;ActivateRefsEarly).filters.numread after the source's own step (a_show_edge_...,the_filter_count_is_read_after_the_sources_own_step;FiltersForward,SourceAfterFilters,FilterCountOnce).async_renderedanddeinterlace_renderedare cleared last (the_rendered_flags_are_cleared_last;ClearFirst).No intentional differences. The
rust/README.mdrow is added; no user-visible change, so nodocs/features.mdline.Evidence
RED, at the RED commit:
GREEN, at the head:
Tier 2, in the linux-validate build volume (
xvfb-run -a), against both libraries, at the extraction commit and at the head:test_source_video_tick_entry(new)test_source_video_tick_callbackstest_source_async_tick_entrytest_source_media_actionsA mutant of the Rust core (rendered flags cleared before the plugin's tick, activate edge before the show edge) fails 3 of the new test's 5 cases on the hybrid library and none on the C reference, so the hybrid runs the Rust export.
OBS_CMOCKA_LINK=false uv run --no-project ci/windows_link_check.pylinks every test binary../lintpasses.Test cost
new tests: longest 0.20 s (the Tier 3 grid at the default level; 0.13 s for all 24 with
OBS_PARITY_CASES=reduced, debug, filtered binary), peak RSS 26 MB over 25 runs (the whole test process), no own threads. The new cmocka test takes a few seconds per library.🤖 Generated with Claude Code