Skip to content

rust: Port the video stop check to obs-core #4670

Closed

Description

@rdoupe

Unit

stop_requested in libobs/obs-video-stop-requested.c.h (3-14, static inline; its only caller is obs-video.c.h's graphics thread loop), to rust/obs-core, new module video_stop_requested.

Phase and position

Phase 6, libobs core (#444). The extraction and its characterization landed in #4099, which closed the earlier port issue #4098 before the Rust half was done. This is that Rust half. Siblings from the same obs-video.c.h split: the render size (#4285, ported in #4541) and the graphics task loop (#4408).

Dependencies and existing tests

  • No dependencies: libobs: characterize and extract the video stop traversal #4099 is on master, and no open PR touches the file.
  • test/cmocka/test_video_stop_requested.c characterizes the C: every stopped vector up to four mixes (and the empty list), the answer, that every mix is asked even after one is running, and that the real mixes_mutex is held across every query and released on return. It stays unchanged and gains a _rust variant against the Rust implementation.

Notes

  • Shape: the same as the render size port. The live obs-video-stop-requested.c.h becomes a private bridge that passes the core and small C accessors (lock and unlock of mixes_mutex, mixes.num, mix i's video) plus video_output_stopped to a hidden Rust obs_video_stop_requested. The original C stays as the C reference and the Tier 3 oracle.
  • Keep the C's order: one lock around the whole loop, num read once under it, no early exit.
  • No threads, no SIMD, no host code. No intentional differences expected.

Activity

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

    @rdoupe
    CollaboratorAuthor

    Claiming: the video stop check port (batched with the graphics task loop, #4408, if its claim frees up).

    1. RED: a _rust variant of the unchanged test_video_stop_requested and Tier 1 mirrors in rust/obs-core/tests/obs_core/video_stop_requested.rs, against a todo!() stub.
    2. GREEN: the safe core obs-core::video_stop_requested (one lock around the loop, num read once, every mix asked), and the hidden obs_video_stop_requested shim behind the C bridge in obs-video-stop-requested.c.h; the original C becomes the C reference in its own ported group.
    3. Tier 3: an oracle over the extracted C with the real private layouts, exact parity of the answer, the call log and the lock state, with a planted mutant.
    4. Docs: the rust/README.md row and naming.md.

    Draft PR expected today.

  3. added
    ready
    on Nov 11, 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