Skip to content

rust: Port the transition load, scale type and swap checks in obs-source-transition.c to obs-source #2595

Closed

Description

@rdoupe

Rust port, round 11 unit 2: the transition load, scale type and swap checks left in libobs/obs-source-transition.c.h, moved to obs-source next to transition_start, transition_clock and transition_render.

Unit

libobs/obs-source-transition.c.h (the decisions only) to rust/obs-source, new module transition_load.

Phase and position

Phase 6 (libobs core), the core-source+ group. After the canvas flag rules (#2546) and the slot-A release fix (#2584), which changed the load this unit moves.

Dependencies and existing tests

Rust takes over these decisions, on plain values:

  • transition_valid(): the type check after obs_ptr_valid();
  • valid_scale_type(), used by obs_transition_set_scale_type() and obs_transition_load(): the three valid values, else Max Only;
  • obs_transition_load(): whether the source is looked up (a name), and the outcome of the lookup and add (keep, not found and warn, or the recursion refusal: release, none and warn); whether the old slot-A source leaves the active children (libobs: Release slot A in obs_transition_load #2584);
  • copy_source_state(): whether the new child is stored or refused for recursion (nothing stored, inactive);
  • obs_transition_swap_begin() and _end(): the same-transition gate.

C keeps both mutexes and their order, every obs_get_source_by_name(), obs_source_get_ref()/_release(), the active child calls, the obs_data reads, the (uint32_t) truncations of the loaded alignment and size and the mode taken as is, the fields the swap hands over, the texrender swap, recalculate_transition_size()/_matrices(), every log, and all of transition audio mixing (untouched).

Existing real-libobs tests: test_transition_load_release, test_transition_scale_type, test_transition_swap, test_transition_swap_active, test_transition_swap_cycle, test_transition_set_cycle, test_transition_start_steps. A characterization test of the moved decisions (test_transition_load_steps) lands first.

Notes

  • Concurrency: each decision is its own function, asked at its own point, so no call or read moves out of its lock section or its condition.
  • No SIMD, no per-OS code, no struct mirrored, no pointer crosses. The enum values cross as int and are checked with _Static_assert.
  • Expected intentional differences: none.

Plan

The standard six commits:

  1. move (behaviour-neutral);
  2. characterization test;
  3. Tier 1 RED;
  4. GREEN in a libobs.ported-source-transition-load group;
  5. Tier 3 parity;
  6. docs.

Activity

  1. added
    enhancement
    port
    ready
    on Oct 27, 2026
  2. rdoupe commented on Oct 27, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2595 (round 11 unit 2, transition load, scale type and swap checks).

    1. Move the decisions into libobs/obs-source-transition-load.c.h (hidden, declared in obs-source-transition-load.h), behaviour-neutral, checked with a harness against master's functions.
    2. Characterization: test_transition_load_steps.
    3. Tier 1 RED against todo!().
    4. GREEN: rust/obs-source transition_load and its shims, in a new libobs.ported-source-transition-load group.
    5. Tier 3 parity against the C oracle, with a mutation check.
    6. Docs.

    Draft PR once the RED commit exists, today.

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