Repository navigation
libobs: Add seam calls, move transition stop - #3841
Merged
Merged
Conversation
rdoupe
force-pushed
the
fix/rust-port-add-the-transition-sea-656
branch
from
November 7, 2026 09:52
1688b89 to
e4a585f
Compare
This was referenced Nov 7, 2026
rdoupe
force-pushed
the
fix/rust-port-add-the-transition-sea-656
branch
from
November 7, 2026 11:20
e4a585f to
b06c95e
Compare
rdoupe
marked this pull request as ready for review
November 7, 2026 11:49
Collaborator
Author
|
Handed off to the coordinator |
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 7, 2026
Characterization before the clock read and stop helpers of obs-source-transition.c (calc_time(), get_video_time(), obs_transition_get_time(), obs_transition_stop(), handle_stop() and obs_transition_force_stop()) move to their own file and are ported. The source_transition_clock parity tests pin the time rule on plain values; nothing pinned the time through the real video clock, what a force stop calls and signals, or the slots after a stop. test_source_transition_stop creates transitions through the real libobs, with a transition type that counts its transition_stop callback. 7 cases pin: - the auto time: 1.0 never started, just above 0 early in a long start, 1.0 past a short start's end and while left running; - the manual time: 0.0 after the start, the manual time each tick snaps to, and 0.0 again once obs_transition_set() ends it; - a force stop: the callback and the stop signals, idle or running, nothing else changed; only the signals without a callback; nothing on the core's handler for a private transition; - an auto stop rendered directly past the end, and one on an output channel: slot B becomes slot A, the video stop and stop signals and the callback once, and the old slot A no longer active. Transitions need core video, so it builds on Linux only and runs under xvfb-run; without a display the cases skip. Refs #3836.
calc_time(), get_video_time(), obs_transition_stop() and handle_stop() lose `static` (and `inline`) and take transition_-prefixed names, transition_calc_time(), transition_get_video_time(), transition_stop() and transition_handle_stop(), so the transition renders can still call them once they move out of obs-source-transition.c with obs_transition_get_time() and obs_transition_force_stop(). Their bodies are unchanged, and the rename is the only edit to their callers. obs-source-transition-stop.h declares them, hidden in libobs (not EXPORT), and says which expects transition_mutex held: all but transition_handle_stop(), called after it is let go. libobs.pch.h includes it with the other transition headers. No other function of libobs or rust/ has these names; transition_stop is otherwise a signal name and an obs_source_info member. Refs #3836.
transition_calc_time(), transition_get_video_time(), obs_transition_get_time(), transition_stop(), transition_handle_stop() and obs_transition_force_stop() move verbatim from obs-source-transition.c into obs-source-transition-stop.c, ahead of their port to rust/obs-source-seam. The renders that call the four helpers stay behind and reach them through obs-source-transition-stop.h. The file has its own copy of lock_transition() and unlock_transition(), #undef'd at its end (BUILD.md), and is live C in libobs.core-source, after the seam in the group's sorted order. No behaviour change: the moved text is byte-identical to the text it replaces, and the export sets of the C, hybrid and C reference builds are unchanged, with the four helpers local. Refs #3836.
The transition seam gets four accessors that the ports of the transition start and set and of the clock read and stop will call in place of the lines they wrap: obs_source_transition_seam_call_start() and _call_stop() (the type's transition_start or transition_stop callback, when it has one, and whether it had one), obs_source_transition_seam_dosignal() (obs_source_dosignal()) and obs_source_transition_seam_get_video_time() (the latest video frame's time). obs-source-transition-seam.h declares them, hidden in libobs like the seam's other accessors; here they are stubs that call and return nothing. test_source_transition_seam_calls pins them. They are hidden, so it builds the seam and the load checks into itself and runs them on a stand-in core (its signal handler and video stats) and stand-in transitions with counted callbacks, their own signal handler and the private flag. 6 cases: both calls with and without their callbacks, the two signals each dosignal emits (a NULL name skipped, a private transition only on its own handler), and the video time against the frame time. All 6 fail on the stubs. Refs #3835.
The four transition seam accessors get their bodies, each a single call copied from the line it wraps: - obs_source_transition_seam_call_start() and _call_stop() call the type's transition_start (or transition_stop) on the context data when it is set, as obs_transition_start() and handle_stop() do, and return whether it was; - obs_source_transition_seam_dosignal() calls obs_source_dosignal() with both names as given; - obs_source_transition_seam_get_video_time() returns obs_video_stats_frame_time(&obs->video.stats), as transition_get_video_time() reads it. The Rust oracle compiles the seam (rust/obs-c-oracle/oracle/source_transition_settings.c), and nothing there defines libobs's core pointer, obs, that the new accessors read: the MSVC linker keeps that reference and fails the obs-data tests. The file now renames obs to a pointer of its own; no parity test calls these accessors. No C caller changes: the transition code keeps its direct calls until the ports replace them. test_source_transition_seam_calls passes 6/6, and the export sets of the C, hybrid and C reference builds are unchanged, with the accessors local. Fixes #3835. Fixes #3836. Local-Gate: v1 tree=09c80cbac853745f57f2cecd86834a47312576c4 secs=2301 lanes=lint:run,dylint:run,rust-test:run,cross:run,tier2-linux:run,macos-native:n/a,windows-native:n/a Ci-Attestation: {"at":1794135007,"gate":"rust/all/fmt","host":"linux-x86_64","key":"b158899e0204e4227bb47875ccaae3ac5af71324f8b64bb1a836dcb17fd34b22","lane":"lint","parents":["3312c1ceeb9830ac1f6d615b26076f3d64b9579f"],"secs":49,"stamp":"0c37d7dba93e613c9aebbaf0dbc8ac74","tree":"09c80cbac853745f57f2cecd86834a47312576c4","v":1,"via":"run"} Ci-Attestation: {"at":1794135007,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"b158899e0204e4227bb47875ccaae3ac5af71324f8b64bb1a836dcb17fd34b22","lane":"lint","parents":["3312c1ceeb9830ac1f6d615b26076f3d64b9579f"],"secs":49,"stamp":"7b028504a07fe3c925f0a711f2bed1e8","tree":"09c80cbac853745f57f2cecd86834a47312576c4","v":1,"via":"run"} Ci-Attestation: {"at":1794135007,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"7796e1570a4d670208e59698eaf796427e3cef17da795ed02a2f6fa77eb5c513","lane":"rust-test","parents":["3312c1ceeb9830ac1f6d615b26076f3d64b9579f"],"secs":215,"stamp":"9dc459bf54ad1ffa259062f02b319d50","tree":"09c80cbac853745f57f2cecd86834a47312576c4","v":1,"via":"run"} Ci-Attestation: {"at":1794135007,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"e0acbd54382ca41a8d0916cd05b58bfb8f3da14c51765dc827b28e8403a2102f","lane":"cross","parents":["3312c1ceeb9830ac1f6d615b26076f3d64b9579f"],"secs":35,"stamp":"6df4e15eb9fc440f19235e3cfe69c657","tree":"09c80cbac853745f57f2cecd86834a47312576c4","v":1,"via":"run"} Ci-Attestation: {"at":1794135007,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"e0acbd54382ca41a8d0916cd05b58bfb8f3da14c51765dc827b28e8403a2102f","lane":"cross","parents":["3312c1ceeb9830ac1f6d615b26076f3d64b9579f"],"secs":35,"stamp":"bd48ceef9374aa73cab2ec8a16936b05","tree":"09c80cbac853745f57f2cecd86834a47312576c4","v":1,"via":"run"} Ci-Attestation: {"at":1794135007,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"e0acbd54382ca41a8d0916cd05b58bfb8f3da14c51765dc827b28e8403a2102f","lane":"cross","parents":["3312c1ceeb9830ac1f6d615b26076f3d64b9579f"],"secs":35,"stamp":"7ae57c56093071539a170f684000083b","tree":"09c80cbac853745f57f2cecd86834a47312576c4","v":1,"via":"run"} Ci-Attestation: {"at":1794135007,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"e0acbd54382ca41a8d0916cd05b58bfb8f3da14c51765dc827b28e8403a2102f","lane":"cross","parents":["3312c1ceeb9830ac1f6d615b26076f3d64b9579f"],"secs":35,"stamp":"3966984814881f3ee3bd69449b5e6650","tree":"09c80cbac853745f57f2cecd86834a47312576c4","v":1,"via":"run"} Ci-Attestation: {"at":1794135007,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"5b8cd54c75d0564575c11d9a30951c5345d08dfd74c92dc4c4f6718cae6a5a30","lane":"tier2-linux","parents":["3312c1ceeb9830ac1f6d615b26076f3d64b9579f"],"secs":2300,"stamp":"9fffd7e42e11d94322e5d5425956e37f","tree":"09c80cbac853745f57f2cecd86834a47312576c4","v":1,"via":"run"}
rdoupe
force-pushed
the
fix/rust-port-add-the-transition-sea-656
branch
from
November 8, 2026 10:50
b06c95e to
88ae773
Compare
Collaborator
Author
|
Handed off to the coordinator |
This was referenced Nov 8, 2026
This was referenced Nov 8, 2026
This was referenced Nov 8, 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 #3835, #3836
Fixes #3835
Fixes #3836
What and why
Two C-only steps the next transition ports need, batched (coordination.md, "Batch one to three similar issues into one PR"). There is no Rust and no change in behaviour; the ports of the transition start and set and of the clock read and stop to
rust/obs-source-seamcome next and call both.The transition seam's callback, signal and video-time accessors (#3835).
libobs/obs-source-transition-seam.hdeclares four more accessors, hidden in libobs like the seam's others, each a single call copied from the line it wraps:obs_source_transition_seam_call_start()/_call_stop(): the type'stransition_start(ortransition_stop) callback on the context data when it has one, returning whether it had one (obs-source-transition-switch.c.h186-187,obs-source-transition.c.h178-179);obs_source_transition_seam_dosignal():obs_source_dosignal(), both names passed through;obs_source_transition_seam_get_video_time():obs_video_stats_frame_time(&obs->video.stats). It takes the stats mutex; its callers holdtransition_mutex, and the header says so.No C caller changes.
test_source_transition_seam_callspins them: the accessors are hidden, so it builds the seam (and the load checkstransition_valid()asks) into itself over a stand-in core (its signal handler and video stats) and stand-in transitions with counted callbacks, their own signal handler and the private flag. 6 cases: both calls with and without their callbacks, the two signals eachdosignalemits (a NULL name skipped, a private transition only on its own handler), and the video time against the frame time.The transition clock read and stop helpers move to their own file (#3836). The "Extracting a function before porting it" step:
test: Characterize the transition clock and stop):test/cmocka/test_source_transition_stop.c, 7 cases through the real libobs (suitegraphics, Linux with OpenGL, like the other transition tests): the auto time (1.0 never started, just above 0 early in a long start, 1.0 past a short start's end and while left running); the manual time (0.0 after the start, each snapped manual time, 0.0 again onceobs_transition_set()ends it, since it resets the value and keeps the mode); a force stop's callback and stop signals, idle and running, with nothing else changed, only the signals without a callback, nothing on the core's handler for a private transition; and an auto stop rendered directly past its end and one on an output channel (the render thread ends the video, the audio thread the audio): slot B becomes slot A, the video stop and stop signals and the callback once, the old slot A no longer active.libobs: Name the transition clock and stop helpers):calc_time,get_video_time,obs_transition_stopandhandle_stoplosestaticand becometransition_calc_time,transition_get_video_time,transition_stopandtransition_handle_stop, declared in the private headerlibobs/obs-source-transition-stop.h(hidden), which says which expectstransition_mutexheld.libobs.pch.hincludes it, and it is listed insource-sets.d/LIBOBS_SOURCES.json. The rename is the only edit to the callers; no other function in libobs orrust/has these names.libobs: Move the transition clock and stop): the four helpers withobs_transition_get_time()andobs_transition_force_stop()move verbatim intolibobs/obs-source-transition-stop.c.h, live C inlibobs.core-sourceafter the seam in the group's sorted order, with its ownlock_transition/unlock_transition,#undef'd at its end (BUILD.md rule 5). The moved text is byte-identical to the text it replaces (checked withcmp).RED → GREEN
libobs: Stub the transition seam calls): the four accessors declared and stubbed;test_source_transition_seam_callsfails 6/6 (calls_with_callbacks:obs_source_transition_seam_call_start(tr) is not true, ...). The clock and stop move (rust: Port the transition clock read and stop helpers (move them out of obs-source-transition.c) #3836) has no RED commit, by design. coordination.md asks a batch for a RED then GREEN pair per issue, but this issue is testing-policy.md's "Extracting a function before porting it" step: a separate, behaviour-neutral change that moves the functions verbatim, with no Rust and no behaviour change, whose proof is that the unchanged C tests pass. A failing test would need a behaviour change, and the move must not have one. So its proof is the characterization test (passing before the rename, after it and after the move), the byte-identical move, the export sets and the move harness below, as with the earlier transition moves (libobs: Move the transition settings and slots #3537, libobs: Move the transition start and set #3820). Its RED and GREEN come in the port of the new file.libobs: Add the transition seam calls), the stamped head. Runs were on fa0b392cd (on master c37566d), unless noted; the same tree was rebased on master 335f283, then on 19da800 (below).test_source_transition_seam_callspasses 6/6 on the C build (0/6 on the RED commit).ctest -R transition, under Xvfb, TMPDIR unset) pass on all three builds, none skipped: C 28/28, hybrid 33/33,libobs-c-reference33/33 (rebuilt after the change, its mtime checked).test_source_transition_stoppassed 7/7 before the move and after it, and 15/15 repeated runs on the C build.obs_transition_get_timeandobs_transition_force_stopstay exported (T); the four renamed helpers and the four seam accessors are local (t).obs-source-transition.c.hwith its lock macros, and the new file whole, each as its own program over one logging stand-in forstruct obs_sourceand every call they make (the clock rule with scripted results, the frame-time read, the active-child removal, the release, the signals, the stop callback and each lock, double locks flagged), dumping every field of five sources after each round. The logs of 20,000 rounds of 12 random calls (240,000 calls) are byte-identical under gcc and clang at -O0, at -O2, and at -O1 with ASan and UBSan. All 24 planted mutants are caught: each argument of the clock rule, the frame-time read, each lock, the old child's read, its active check, removal and release, both active flags, both slot writes, the callback check and its argument, each signal name, and the force stop's call.--test-diff origin/master(6744 tests passed, 6 skipped, the same on the RED commit),--lane lint,--lane cross, the Windows--all-targetsclippy (x86_64-pc-windows-msvc,-D warnings) and theport_comparisonbench pass. The cross lane caught one Windows link failure on the first GREEN: the Rust oracle compiles the seam (rust/obs-c-oracle/oracle/source_transition_settings.c), and the MSVC linker keeps the new accessors' reference to libobs's core pointerobs, which no oracle that theobs-datatests link defines. The oracle file now renames it to a pointer of its own (no parity test calls these accessors); that is part of the GREEN commit. After the rebase (runs were on 44a78275b, then stamped as e4a585f, same tree): the transition tests pass again on all three builds, none skipped (C 28/28, hybrid 33/33,libobs-c-reference33/33); the export sets are still identical (1767);./unittestpassed (Rust 6761 and 912 tests, Tier 2 751/751 on hybrid libobs andlibobs-c-reference); the quickci/checks,./lint,--lane lint,--lane cross, the Windows--all-targetsclippy and theport_comparisonbench pass.ci/test_native_b2_portability.py, which landed on master after this branch's base, pins the evaluated Linux core inventory, andtest_source_transition_seam_callsis a core test every host runs.test: Count the seam calls test in the inventoryraises its counts by one (418, and 425 with both SDK additions);test_source_transition_stopis a graphics test and does not count. Rebased on master 19da800 (runs were on b06c95e): the check passes; the transition tests pass on all three builds, none skipped (C 28/28, hybrid 33/33,libobs-c-reference33/33); the export sets are identical (1767);--lane lint,--lane crossand the Windows--all-targetsclippy pass. Theport_comparisonbench test now aborts in its service module on master itself (f96b82e, without this change): filed as bug: obs-c-oracle: port_comparison service bench dereferences its stand-in output #3886, not from this PR.ci/test_native_b2_portability.pyto check the inventory's differences and a floor (at least 417) instead of exact counts, so the count commit had nothing left to change and was dropped; the check passes. The transition tests pass on all three builds, none skipped (C 28/28, hybrid 33/33,libobs-c-reference33/33); the export sets are identical (1767); the quickci/checks,./lint,--lane lint,--lane crossand the Windows--all-targetsclippy pass. Theport_comparisonbench still aborts in its service module, as on master (bug: obs-c-oracle: port_comparison service bench dereferences its stand-in output #3886).ci-lint local-gate run: lint, rust-test, cross and Tier 2 on Linux (tier2-linux) passed, and HEAD is stamped (stamped again on 88ae773 after the last rebase, every lane run); the macOS and Windows native lanes do not apply on this host. Its first Tier 2 run failedtest_color_correction_16f, which no file here touches; it passed 10/10 alone on the C, hybrid and C reference builds and in the./unittestTier 2 run just before, and the gate's rerun passed.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)