Skip to content

rust: Move the transition child slots out of obs-source-transition.c #3530

Closed

Description

@rdoupe

Unit

libobs/obs-source-transition.c.h: the transition's child slot functions move verbatim into a new libobs/obs-source-transition-slots.c.h (live C in libobs.core-source), ahead of their port to rust/obs-source:

  • obs_transition_clear (91-115)
  • obs_transition_enum_sources (720-728)
  • copy_source_state (1144-1172, static inline)
  • obs_transition_swap_begin (1174-1206)
  • obs_transition_swap_end (1208-1225)

The exported ones stay EXPORT through obs.h (obs_transition_enum_sources stays declared in obs-internal.h); the export sets do not change.

Phase and position

Phase 6 (libobs core), the "Extracting a function before porting it" step for the child slots; tracking issue #4. Same PR as the transition field seam, whose transition_valid obs_transition_clear calls.

Dependencies and existing tests

  • The transition field seam (same PR).
  • test_transition_swap, test_transition_swap_active and test_transition_swap_cycle pin the swap's handover of a running transition and its refusal of a source that contains the destination; nothing pins obs_transition_clear releasing both children, the order obs_transition_enum_sources visits them in, or the texture handover of obs_transition_swap_end. A characterization test, test_source_transition_slots, lands first: through the real libobs (Linux under Xvfb, as the other transition tests) it pins clear releasing both slots and the active state, the enum order (A, then B, skipping empty slots), the swap handing over sources and flags with the begin/end pairing the frontend uses, and a swap of a transition with itself doing nothing.

Notes

No behaviour change. obs_transition_swap_begin takes both texture locks and obs_transition_swap_end drops them; the lock order (source, then destination) stays. The move keeps the file-local lock macros as the file's own copy, with their #undefs (BUILD.md).

Activity

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

    @rdoupe
    CollaboratorAuthor

    Claiming: #3530.

    Batched in one PR with #3528 (the transition field seam) and #3529 (the transition settings move).

    1. Characterization: test/cmocka/test_source_transition_slots.c through the real libobs (core video, Linux under Xvfb): clear releasing both slots, the enum order, the swap handing over sources and flags with the begin/end pairing the frontend uses, and a swap with itself doing nothing. It waits on results, not frames.
    2. Move the five functions verbatim into libobs/obs-source-transition-slots.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
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