Skip to content

rust: Port the source colour space query routing in obs-source.c to obs-source #1979

Closed

Description

@rdoupe

Unit

Port the colour space query routing in libobs/obs-source.c.h obs_source_get_color_space to rust/obs-source, as a new module color_space. These decisions move:

  • a non-filter source with no video asks its filter parent;
  • a filter with no video asks its target (libobs: Fix color space query through non-video filters #1493);
  • a source with no data, or a disabled one, asks its target;
  • an async source picks from preferred_spaces against its frame's space. The loop keeps the last preferred space when none matches.

These stay in C: data_valid, the recursion into the parent or target, the video_get_color_space callback, and convert_video_space. C passes in the frame's space.

Plan (one PR, separate commits)

  1. A behaviour-neutral move into libobs/obs-source-color-space.c.h, as hidden route and pick functions. C reads the fields into a small struct.
  2. Characterization, test_source_color_space_steps, covering:
    • every route for all 64 combinations of the six inputs;
    • the async pick with an empty list, a match first, a match last and no match;
    • a filter that is also flagged async;
    • an out-of-range value in the list.
  3. RED, then GREEN: the safe Rust core plus shims, in a libobs.ported-source-color-space group. Exported symbols are unchanged.
  4. Tier 3 parity, exhaustive over the 64 rows, plus a proptest over preferred lists of 0–8 arbitrary values. Also a deliberate-break check and port_comparison numbers.

test_filter_color_space (real libobs, #1493) must stay green on every lane.

Activity

  1. rdoupe commented on Oct 23, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: #1979.

  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