Skip to content

rust: Port the transition render and audio steps in obs-source-transition.c to obs-source #2173

Closed

Description

@rdoupe

Unit

Port the transition render and audio step decisions in libobs/obs-source-transition.c.h to rust/obs-source, as a new module transition_render, next to transition_clock. These decisions move:

  • obs_transition_video_render2: the stop step at t >= 1, and the draw choice:
    • transitioning with textures draws both;
    • audio-only shows source B;
    • otherwise source A.
  • obs_transition_video_render_direct: the stop step with the inactive-source rule, and the source index.
  • obs_transition_audio_render: dropping removed sources, the stop step, and mixing both sources or copying source A.
  • transition_process_audio: the validity check and pos.
  • recalculate_transition_matrix: the scaled size and the alignment offsets after the ported fit.

These stay in C:

  • the lock, copy_transition_state and the refs;
  • obs_transition_stop, handle_stop and the signals;
  • mix_child and get_sample_time;
  • add_alignment and the matrix calls.

Plan (one PR, separate commits)

  1. A behaviour-neutral move into libobs/obs-source-transition-render.c.h, as hidden functions.
  2. Characterization in test_transition_render_steps. It covers:
    • every stop-step combination, at t just below, at and above 1, including NaN;
    • the direct index for every flag;
    • the audio step with each source present, removed or pending;
    • pos at and around min_ts, and the u64 wrap;
    • the matrix inputs for each scale type and alignment.
  3. RED, then GREEN: the safe Rust core plus shims, in a libobs.ported-source-transition-render group. Exported symbols are unchanged.
  4. Tier 3 parity against the original C:
    • exhaustive over the flags;
    • a proptest over f32 bit patterns, full-range timestamps and sizes;
    • a deliberate-break check and port_comparison numbers.

These real-libobs tests must stay green on every lane:

  • test_transition_swap
  • test_transition_scale_type
  • test_transition_recursive_destination
  • test_item_transition_empty_source
  • test_saved_transition
  • the transition clock tests
  • the transition audio tests

Activity

  1. rdoupe commented on Oct 24, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #2173.

  2. added
    claimed
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions