Skip to content

rust: Port the transition sizing and tick (move them out of obs-source-transition.c) #3580

Closed

Description

@rdoupe

Unit

libobs/obs-source-transition.c.h: the transition sizing and tick move verbatim into a new libobs/obs-source-transition-size.c.h (live C in libobs.core-source), ahead of their port to rust/obs-source:

  • the add_alignment declaration (81)
  • get_cx / get_cy (83-91, static inline)
  • recalculate_transition_matrix (93-130, static) and recalculate_transition_matrices (132-136, static inline)
  • recalculate_transition_size (138-159, static)
  • obs_transition_tick (161-185), declared in obs-internal.h and called from obs-source.c.h

The four helpers the rest of the file still calls (get_cx, get_cy, recalculate_transition_matrices, recalculate_transition_size) lose static and are declared in a private header, libobs/obs-source-transition-size.h ("private adapter, not a new public API", like the seam header), under transition_-prefixed names so they cannot clash in the unity group: transition_get_cx, transition_get_cy, transition_recalculate_matrices, transition_recalculate_size. Renaming the callers in obs-source-transition.c.h (257-258, 405-406, 578-579, 607-608, 727-728) is the only edit to them. None of them is EXPORT; the export sets do not change.

Phase and position

Phase 6 (libobs core), the "Extracting a function before porting it" step for the transition sizing and tick; tracking issue #4 (Phase 6 tracker #444, its seam item for the transition fields). It follows the child slots port (#3562), and is batched in one PR with the moves of obs_transition_load and of the transition source getters and manual controls, which are filed next to this one.

Dependencies and existing tests

  • The transition field seam and the clock rules (obs-source-transition-seam.c.h, obs-source-transition-clock.c.h), both on master.
  • Nothing pins the actual size, the matrices or the manual value after a tick. A characterization test, test_source_transition_size, lands first: through the real libobs (core video, Linux under Xvfb, as the other transition tests), with a minimal transition type and fixed-size test sources, it pins transition_actual_cx / cy through obs_source_get_width / _height after a tick, the unsized case, the matrices through the drawn result, and the manual value after ticks in manual mode.

Notes

No behaviour change. The new file has its own copy of the lock macros it uses, with their #undefs (BUILD.md). The unlocked writes of transition_actual_cx / cy and transition_manual_val that #3570 reports move as they are; the fix there then applies to the new file.

Activity

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

    @rdoupe
    CollaboratorAuthor

    Claiming: #3580.

    Batched in one PR with #3581 (the move of obs_transition_load, which calls these helpers) and #3582 (the move of the transition source getters and manual controls).

    1. Characterization: test/cmocka/test_source_transition_size.c through the real libobs (core video, Linux under Xvfb): the actual size after a tick, the unsized case, the matrices through the drawn result, and the manual value after ticks in manual mode.
    2. The private header libobs/obs-source-transition-size.h with the four renamed helpers, and the callers renamed.
    3. Move lines 81-185 verbatim into libobs/obs-source-transition-size.c.h (its own copy of the lock macros, with their #undefs), included in libobs.core-source. Checked with the move harness; the export sets stay identical.

    Draft PR expected within a day.

  3. added
    ready
    on Nov 3, 2026
  4. rdoupe commented on Nov 3, 2026

    @rdoupe
    CollaboratorAuthor

    Fixed by PR #3588 (merged through the merge queue), batched with #3581 and #3582.

    What changed: add_alignment, get_cx/get_cy, recalculate_transition_matrix/_matrices, recalculate_transition_size and obs_transition_tick moved verbatim out of libobs/obs-source-transition.c.h into the new libobs/obs-source-transition-size.c.h (live C in libobs.core-source). The four helpers the rest of the file still calls are now transition_get_cx, transition_get_cy, transition_recalculate_matrices and transition_recalculate_size, declared in the private header libobs/obs-source-transition-size.h. A new characterization test, test_source_transition_size, pins the behaviour, and the export sets are unchanged. No behaviour change.

    What is left: the Rust port of the sizing and tick into rust/obs-source (RED then GREEN, all four test tiers). No issue is filed for it yet. The unlocked writes of transition_actual_cx/cy and transition_manual_val moved as they were; their fix is #3570, which now applies to the new file.

    No tracking-issue checkbox exists for this unit (#4 and #444 list none).

  5. moved this from In progress to Done in obs-rust Multiviewon Nov 4, 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