Skip to content

rust: Port obs-view.c to obs-core #1933

Closed

Description

@zackees

Port libobs/obs-view.c.h (193 lines) to Rust. The last plain-C unit in the core-source group besides the scene-item audio glue. Same approach as the obs-service port (#1899, #1913, #1920).

Functions: obs_view_create, obs_view_destroy, obs_view_get_source, obs_view_set_source (ref the new source, swap under channels_mutex, activate the new one and deactivate/release the old one after the lock), obs_view_render (drop removed sources, render the rest, under the lock), obs_view_add / obs_view_add2 / obs_view_remove / obs_view_enum_video_info (the obs->video.mixes list), and the internal obs_view_init / obs_view_free that obs-canvas.c calls on its embedded view.

struct obs_view is embedded in struct obs_canvas, so its layout stays C; Rust reaches the mutex, channels and type through hidden accessors, and the source and mix calls (obs_source_*, obs_create_video_mix) stay C behind FFI. Exported symbols and public headers unchanged. Target crate: obs-core.

Tests: Tier 2 cmocka characterization test_view first (channel bounds, refs and activation counts through a test source, set/replace/clear, render dropping a removed source, add/remove/enum of mixes, NULL cases), then Tier 1, Tier 3 differential against the oracle, port_comparison numbers.

Activity

  1. zackees commented on Oct 23, 2026

    @zackees
    MemberAuthor

    Claiming: #1933.

    1. test PR: cmocka characterization test_view (Tier 2).
    2. port PR (stacked): RED, safe core, GREEN swap, bench.
  2. added
    claimed
    on Oct 23, 2026
  3. zackees commented on Oct 23, 2026

    @zackees
    MemberAuthor

    Done: Tier 2 characterization #1934, port #1935 (merged). struct obs_view stays C (embedded in obs_canvas) behind hidden accessors; source and mix calls stay C.

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