Skip to content

rust: Port the transition field seam (obs-source-transition.c) #3528

Closed

Description

@rdoupe

Unit

libobs/obs-source-transition.c.h (C only, no crate yet): a private seam over the transition fields of struct obs_source, so the later ports of the transition settings and child slots to rust/obs-source can read and write them without the struct layout. New libobs/obs-source-transition-seam.c.h (live C in libobs.core-source) and its hidden header libobs/obs-source-transition-seam.h (no EXPORT):

  • transition_valid (53-61), transition_active (348-351) and valid_scale_type (568-571) move into it verbatim, losing only static inline, so other files of the group can call them.
  • One get/set pair per transition field the file reads or writes, plus lock, unlock and trylock wrappers for transition_mutex and transition_tex_mutex. Each is one field read, write or pthread_mutex_* call. Nothing calls them yet.

This is the "internal accessors or adapter seams" step that "Public and internal boundaries" in the testing policy asks for before stateful code is ported, and an item of the Phase 6 core-migration tracker (#444).

Phase and position

Phase 6 (libobs core), the next step of the remaining obs-source-transition.c.h C; tracking issue #4. The transition clock (#2040), render and audio steps (#2173), start checks (#2473), load checks (#2595) and per-sample time (#3481) are on master. The moves of the transition settings and child slots go in the same PR and use this seam.

Dependencies and existing tests

  • None. No open PR edits obs-source-transition.c.h, the core-source group or its precompiled header. The seam does not touch obs-internal.h or obs-source.c.h.
  • Behaviour-neutral, so the unchanged C tests are the check: the transition tests (test_transition_*, test_group_hide_transition_audio) and the Rust source::transition_* parity tests. The exported symbol sets stay identical on the C, hybrid and C reference builds (the seam is hidden by libobs's default visibility).

Users of the fields outside the transition file today, all reads: obs-scene.c.h 176 (transitioning_audio, transitioning_video) and obs-source.c.h 2264 and 2286 (transition_actual_cx, transition_actual_cy). The full inventory goes in the PR and on #444.

Notes

No SIMD, no host-specific code. The accessors and lock wrappers are plain C; the locks stay where they are taken today. No name clash in libobs.core-source: no other file there defines transition_valid, transition_active or valid_scale_type.

Activity

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

    @rdoupe
    CollaboratorAuthor

    Claiming: #3528.

    One PR with #3529 (the transition settings move) and #3530 (the child slots move), which use this seam.

    1. Move transition_valid, transition_active and valid_scale_type verbatim into libobs/obs-source-transition-seam.c.h, declared in the hidden obs-source-transition-seam.h (in libobs.pch.h), included in libobs.core-source ahead of the transition file. Checked against origin/master's functions with a move harness (gcc and clang, -O0 and -O2, ASan/UBSan, planted mutants).
    2. Add the field accessors and the lock, unlock and trylock wrappers to the seam, with no caller.
    3. The unchanged C tests and the transition parity tests pass; the export sets stay identical on the C, hybrid and C reference builds. The inventory of every field's users goes in the PR and on meta: Phase 6 libobs core migration through opaque C seams #444.

    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 #3537 (merged through the merge queue as 6476ead, 2026-11-03), which batched this issue with #3529 and #3530.

    What landed for this issue: transition_valid(), transition_active() and valid_scale_type() moved verbatim into the new live C file libobs/obs-source-transition-seam.c.h (hidden header obs-source-transition-seam.h, nothing EXPORT), plus one get/set per transition field of struct obs_source and lock, unlock and trylock wrappers for transition_mutex and transition_tex_mutex. Nothing calls the accessors yet. No Rust and no behaviour change; the exported symbol sets are identical to master's.

    What is left: the ports of the transition settings (#3529) and the child slots (#3530), now moved into their own C files, to rust/obs-source, reading the fields through this seam. There is no open issue for those ports yet, so no follow-up number to link; it needs filing before they are claimed. The per-field inventory of users that this issue promised for #444 is in the PR description.

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