Skip to content

rust: Port the transition clock read and stop helpers (move them out of obs-source-transition.c) #3836

Closed

Description

@rdoupe

Unit

libobs/obs-source-transition.c.h: the transition clock read and stop helpers move verbatim into a new libobs/obs-source-transition-stop.c.h (live C in libobs.core-source), ahead of their port to rust/obs-source-seam:

  • calc_time (81-85, static)
  • get_video_time (87-91, static inline)
  • obs_transition_get_time (93-102, obs.h)
  • obs_transition_stop (162-174, static)
  • handle_stop (176-181, static inline)
  • obs_transition_force_stop (183-186, obs.h)

Their callers stay behind in obs-source-transition.c.h: get_video_time (211, 343), calc_time (482), obs_transition_stop (223, 357, 490) and handle_stop (293, 382, 530), in the video and audio renders. So the four static helpers lose static and take transition_-prefixed names (transition_calc_time, transition_get_video_time, transition_stop, transition_handle_stop), declared in a private header libobs/obs-source-transition-stop.h ("private adapter, not a new public API", like the size header) that libobs.pch.h includes beside the size header. The rename is the only edit to the callers. A grep of libobs and rust/ finds no function of those names (transition_stop is otherwise only a signal name and an obs_source_info member).

Phase and position

Phase 6 (libobs core), the "Extracting a function before porting it" step for the transition clock read and stop; tracking issue #4 (Phase 6 tracker #444). Follows the move of the transition start and set (#3794, merged in #3820), and is batched in one PR with the transition seam's callback, signal and video-time accessors (#3835), which the port that follows calls.

Dependencies and existing tests

  • The clock rule (obs-source-transition-clock.c.h, ported), the seam, all on master.
  • Existing coverage: the source_transition_clock parity tests (the time rule); test_source_transition_settings (force stop only signals and leaves the transition running); the render-step tests for the stop decisions.
  • A characterization test, test_source_transition_stop, lands first through the real libobs: obs_transition_get_time in auto and manual mode before, during and after a transition; obs_transition_force_stop's stop callback count and transition_stop / source_transition_stop signals; and the slots and active-child counts after an auto transition's stop, through obs_transition_get_source / _get_active_source. Only valid transitions: a NULL transition crashes these.

Notes

No behaviour change. The new file has its own copy of lock_transition / unlock_transition, with their #undefs (BUILD.md). The header says which helper expects transition_mutex held (transition_stop, called under it) and which doesn't (transition_handle_stop, called after it is dropped). The renamed helpers are hidden; the export sets stay identical on the C, hybrid and C reference builds.

Activity

  1. added
    enhancement
    port
    on Nov 7, 2026
  2. rdoupe commented on Nov 7, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #3836.

    Batched in one PR with #3835 (the transition seam's callback, signal and video-time accessors).

    Plan:

    1. Characterization test test/cmocka/test_source_transition_stop.c through the real libobs: obs_transition_get_time in auto and manual mode, obs_transition_force_stop's callback and signals, and the slots and active children after an auto transition stops.
    2. The private header libobs/obs-source-transition-stop.h and the rename of the four static helpers to transition_calc_time, transition_get_video_time, transition_stop and transition_handle_stop (the only edit to their callers).
    3. The move of the six functions verbatim into libobs/obs-source-transition-stop.c.h, ahead of obs-source-transition.c.h in libobs.core-source, with its own lock macros; checked against master's functions with a move harness, and the export sets unchanged.

    Expected PR (draft): today, with #3835.

  3. added
    ready
    on Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementportready

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions