Skip to content

rust: Port the transition seam's callback, signal and video-time accessors #3835

Closed

Description

@rdoupe

Unit

libobs/obs-source-transition-seam.h / libobs/obs-source-transition-seam.c.h (live C in libobs.core-source): four new accessors, so the coming ports of the transition start and set and of the clock read and stop helpers to rust/obs-source-seam can call a transition's callbacks, emit its signals and read the video time without the struct layout:

  • bool obs_source_transition_seam_call_start(obs_source_t *transition): calls info.transition_start(context.data) when it is set, and returns whether it was (obs-source-transition-switch.c.h 186-187).
  • bool obs_source_transition_seam_call_stop(obs_source_t *transition): the same for info.transition_stop (obs-source-transition.c.h 178-179).
  • void obs_source_transition_seam_dosignal(obs_source_t *transition, const char *signal_obs, const char *signal_source): calls the static inline obs_source_dosignal() (obs-internal.h), as obs-source-transition.c.h 180 and 291 and obs-source-transition-switch.c.h 207 and 240 do. Both strings pass through unchanged (a NULL one is skipped by obs_source_dosignal).
  • uint64_t obs_source_transition_seam_get_video_time(void): returns obs_video_stats_frame_time(&obs->video.stats) (obs-source-transition.c.h 89). It takes obs->video.stats.mutex; its callers hold transition_mutex, and the header comment says so.

Each is a single call, copied from the line it wraps. No C caller changes: the transition code keeps its direct calls until the ports replace them. Hidden in libobs (not EXPORT), like the seam's other accessors.

Phase and position

Phase 6 (libobs core), transition seam; tracking issue #4 (Phase 6 tracker #444). Follows the move of the transition start and set (#3794, merged in #3820). Batched in one PR with the extraction of the transition clock read and stop helpers (filed next).

Dependencies and existing tests

  • The seam (obs-source-transition-seam.c.h) and its field accessors, on master. Its existing accessors are covered by the seam parity tests in rust/obs-source-seam/tests/source_seam/, through the oracle's copy of the seam.
  • Nothing tests these four yet. A characterization test, test/cmocka/test_source_transition_seam_calls.c, builds the seam into itself (the accessors are hidden) over a stand-in core and transition: a transition type with counting start and stop callbacks and without them, a signal handler on the core and on the transition, a private transition, and a video frame time. It pins both calls' return value and callback count, the two signals each dosignal emits (and which it skips for NULL names and a private source), and the video time against the frame time.

Notes

No behaviour change and no Rust: the ports call these. The export sets of the C, hybrid and C reference builds stay identical, with the four accessors local.

Activity

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

    @rdoupe
    CollaboratorAuthor

    Claiming: #3835.

    Batched in one PR with #3836 (the extraction of the transition clock read and stop helpers), which the port that follows needs beside these accessors.

    Plan:

    1. Characterization test test/cmocka/test_source_transition_seam_calls.c: the seam built into the test (the accessors are hidden) over a stand-in core and transition; both calls with and without their callbacks, each dosignal's two signals (NULL names and a private source skipped), and the video time against the frame time. Registered in test/cmocka/build/test-graph.json.
    2. RED: the four accessors declared in libobs/obs-source-transition-seam.h and stubbed in the seam (the test fails).
    3. GREEN: their bodies, each copied from the line it wraps. No C caller changes; the export sets stay identical, with the accessors local.

    Expected PR (draft once RED exists): today.

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

    @rdoupe
    CollaboratorAuthor

    Progress: the four seam accessors and their test (test_source_transition_seam_calls) are in #3841, together with #3836. Its PR checks are green and it went into the merge queue, which removed it again on 2026-11-07. Next: find out why the queue dropped it, fix that if it's ours, and queue it again.

  5. rdoupe commented on Nov 8, 2026

    @rdoupe
    CollaboratorAuthor

    Fixed by #3841 (merged through the merge queue, together with #3836): the four transition seam accessors (start and stop callbacks, signal emit, video time) are in libobs, hidden like the seam's others, with the characterization test test_source_transition_seam_calls. No C caller changed and no Rust was added.

    Left: the ports of the transition start and set and of the clock read and stop helpers to rust/obs-source-seam, which call these accessors. Their port issues are not filed yet, so there is no follow-up issue number to link; they will be filed when a worker takes them. The Phase 6 trackers (#4, #444) list no checkbox for this unit, so none was ticked.

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