Repository navigation
obs-core: Port the video stop check to Rust - #4671
Merged
Merged
Conversation
Tier 1 tests for obs-core's video_stop_requested, ported 1:1 from test_video_stop_requested.c: every stopped vector up to four mixes and the empty list, every mix asked even after one is running, and mixes_mutex held across the count, each mix read and each query, then released. The core is a todo!() stub, so both tests fail. Refs #4670.
stop_requested() in obs-video-stop-requested.c.h is now a bridge to the hidden obs_video_stop_requested(), Rust in hybrid libobs (obs-core::video_stop_requested). The bridge passes the core, its accessors for mixes_mutex, mixes.num and mix i's video, and video_output_stopped(), so the mix list stays C-owned. The Rust keeps the C's order: one lock around the walk, the count read once under it, every mix asked with no early exit. The original C is the C reference, in its own ported group (obs-video-stop-requested-reference.c.h), and the unchanged test_video_stop_requested runs against it and, as test_video_stop_requested_rust, against the Rust. Refs #4670.
Tier 3 for obs-core's video_stop_requested. The oracle compiles the original C (obs-video-stop-requested-reference.c.h) and the production bridge's accessors over a real private core with a real mixes_mutex. The parity test runs both over the same core and compares the answer, every video_output_stopped() call (the video asked and whether the mutex was held) and the released mutex, for every stopped vector up to six mixes and random lists up to 63. Planted mutants caught: an early exit on the first running mix (the query log differs) and the unlock moved before the walk (the count is read unlocked). Refs #4670.
The rust/README.md row for obs-video-stop-requested.c.h, its place in naming.md's obs-core row, and obs-core's Cargo.toml description and module docs. Fixes #4670. Local-Gate: v1 tree=c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a secs=2395 lanes=lint:run,dylint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a Ci-Attestation: {"at":1794385710,"gate":"rust/all/fmt","host":"linux-x86_64","key":"9630d37af094a143d61464be069b33a111346373aa9400e2da86bd8f9c2b7e93","lane":"lint","parents":["4f79d623cdf18bf57661f6dd035837a4f9ff36c3"],"secs":55,"stamp":"25a8d923078242a2855eff60a96e3251","tree":"c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a","v":1,"via":"run"} Ci-Attestation: {"at":1794385710,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"9630d37af094a143d61464be069b33a111346373aa9400e2da86bd8f9c2b7e93","lane":"lint","parents":["4f79d623cdf18bf57661f6dd035837a4f9ff36c3"],"secs":55,"stamp":"3d9981e40d140befae01c2ca0184ecad","tree":"c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a","v":1,"via":"run"} Ci-Attestation: {"at":1794385710,"gate":"rust/x86_64-unknown-linux-gnu/dylint","host":"linux-x86_64","key":"b8cc88edd96ef04db364e6b530de906f165084520671cedde0f19bc5a84f5cc3","lane":"dylint","parents":["4f79d623cdf18bf57661f6dd035837a4f9ff36c3"],"secs":0,"stamp":"52fb0370b425797b6b6a090c15c68c3e","tree":"c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a","v":1,"via":"run"} Ci-Attestation: {"at":1794385710,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"919c23b795ec8b0d3c9adcf257142a5cc4d79256bb1b92c64e775312c4a927c6","lane":"rust-test","parents":["4f79d623cdf18bf57661f6dd035837a4f9ff36c3"],"secs":143,"stamp":"26a2f4f7b6a59be853e0e3720c0cbd83","tree":"c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a","v":1,"via":"run"} Ci-Attestation: {"at":1794385710,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"57db76cd49f47282912aff972368b5e2f53c046ad842a84d1845272320a368a4","lane":"cross","parents":["4f79d623cdf18bf57661f6dd035837a4f9ff36c3"],"secs":78,"stamp":"1414494d67de86e38985e6d468b57cba","tree":"c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a","v":1,"via":"run"} Ci-Attestation: {"at":1794385710,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"57db76cd49f47282912aff972368b5e2f53c046ad842a84d1845272320a368a4","lane":"cross","parents":["4f79d623cdf18bf57661f6dd035837a4f9ff36c3"],"secs":78,"stamp":"3f69986d52acb3c03acb4bf2cfaf01f6","tree":"c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a","v":1,"via":"run"} Ci-Attestation: {"at":1794385710,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"57db76cd49f47282912aff972368b5e2f53c046ad842a84d1845272320a368a4","lane":"cross","parents":["4f79d623cdf18bf57661f6dd035837a4f9ff36c3"],"secs":78,"stamp":"ff45d2e23863b9f430107e13ffde4550","tree":"c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a","v":1,"via":"run"} Ci-Attestation: {"at":1794385710,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"57db76cd49f47282912aff972368b5e2f53c046ad842a84d1845272320a368a4","lane":"cross","parents":["4f79d623cdf18bf57661f6dd035837a4f9ff36c3"],"secs":78,"stamp":"611e3e35c59929cbbdc63a10e47e0cca","tree":"c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a","v":1,"via":"run"} Ci-Attestation: {"at":1794385710,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"3f61850996d7ea6f9664810a7bf77b75b904097bf3f3b17f0787aaf327e4df1c","lane":"tier2-linux","parents":["4f79d623cdf18bf57661f6dd035837a4f9ff36c3"],"secs":2395,"stamp":"74fbd5209109f02e8f85024cc5f57fcd","tree":"c6e5c1f5d95d8e54eeac77a5a0346a4554343f4a","v":1,"via":"run"}
rdoupe
force-pushed
the
fix/rust-port-port-the-graphics-task-739
branch
from
November 11, 2026 08:28
f59b311 to
4af48d9
Compare
rdoupe
marked this pull request as ready for review
November 11, 2026 08:43
7 tasks done
This was referenced Nov 19, 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.
Fixes #4670
Refs #4670
What and why
Ports
stop_requested()(libobs/obs-video-stop-requested.c.h), the graphics thread's per-frame check that every mix's video output has stopped, toobs-core::video_stop_requested. It is the Rust half of the extraction in #4099 (which closed the earlier port issue, #4098, before the port), and a sibling of the render size port (#4541) from the sameobs-video.c.hsplit.obs-video-stop-requested.c.his now a private bridge:stop_requested()calls the hiddenobs_video_stop_requested()(declared in the new privateobs-video-stop-requested.h, notEXPORT, listed inrust-hidden.d) with the core, four accessors (lock and unlock ofmixes_mutex,mixes.num, mixi'svideo) andvideo_output_stopped(). The mix list and its mutex stay C-owned; the Rust reads no private layout.test_video_stop_requested_rustis registered in the native build's Rust-static fixtures (private-steps); linked strictly (--as-needed) against the production archive alone it passes 1/1 and keeps no libobs DSO.obs-video-stop-requested-reference.c.h,libobs.ported-video-stop-requested+).The graphics task loop from the same split (
execute_graphics_tasks(), #4408) is not in this PR: zackees has its port on his own branch under his claim on that issue, and I've asked there whether he wants it carried here. The render size (#4285) already landed in #4541.Upstream: no upstream issue. The C characterization and extraction are zackees' (#4099).
RED → GREEN
obs_core::video_stop_requested::stop_all_combinationsanda_running_first_mix_still_asks_the_rest(Tier 1, ported 1:1 fromtest_video_stop_requested.c) fail on thetodo!()core ("not yet implemented");--lane lintpasses, and--test-difffails on those two tests only.obs_core::video_stop_requested2/2.test_video_stop_requestedpasses against the C reference, and its new_rustvariant against the Rust, on the C and hybrid trees; the 49 video, shutdown and reset tests (ctest -R 'video|shutdown|reset') pass 49/49 against hybridlibobsand 49/49 againstlibobs-c-reference, 0 skipped.obs_core::video_stop_requested_parity2/2 (every stopped vector up to six mixes, and a proptest over lists up to 63). Planted mutants caught: an early exit on the first running mix, and the unlock moved before the walk.ci/local_gate.py --test-diff(8293 passed, 6 skipped),--lane lint,--lane dylint,--lane cross, andcargo clippy --workspace --target x86_64-pc-windows-msvc --all-targets -D warningsall pass.obs_video_stop_requestedis local (t) in all three.OBS_PARITY_CASES=reduced), no threads of their own.Checklist
master(or the description starts with a Stacked: note)docs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): built with scripting ON (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC (not applicable: no warning or flag change)