Skip to content

rust: Port the encoder ROI checks and scaling to obs-output #1969

Closed

Description

@rdoupe

Unit

Port the encoder ROI helpers that #1964 moved into libobs/obs-encoder-roi.c.h to rust/obs-output, as a new module encoder_roi:

  • obs_encoder_roi_admit(): the cap check, the upside-down and NaN refusals, the 16×16 minimum and the priority range;
  • obs_encoder_roi_scale_factors();
  • obs_encoder_roi_scale(): the scaled rectangle, with saturating edges.

These stay in C: roi_mutex, the darray, roi_increment, the reverse walk and enum_proc, the obs_encoder_valid() guards, and the encoder plugins that read the ROIs.

Plan (one PR)

  1. RED, then GREEN: the safe Rust core and #[no_mangle] shims in a libobs.ported-encoder-roi group. The exported symbols stay unchanged. test_encoder_roi (12 cases) stays green on every lane, plus its _rust variant if it links.
  2. Tier 3 parity against the C: a proptest over full-range u32 rectangles, f32 priorities and factors (bit patterns), and sizes, bit-equal. It also includes a deliberate-break check and port_comparison numbers.

Activity

  1. rdoupe commented on Oct 23, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #1969.

  2. added
    claimed
    on Oct 23, 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