You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port the async video GPU conversion plan in obs-source.c to obs-source #2062
Port the async video GPU conversion plan in libobs/obs-source.c.h to rust/obs-source, as a new module conversion_plan.
What moves:
get_convert_type;
the twenty set_*_sizes, and the planning part of init_gpu_conversion: per-plane widths, heights and texture formats, and the channel count;
select_conversion_technique and need_linear_output.
What stays C: set_async_texture_size (the change check, the texture objects, the graphics context), upload_raw_frame, update_async_texrender and the shader parameters. convert_video_format also stays as an inline for its other callers.
Shape: one hidden entry point takes the frame's format, range, trc and size and returns a plan struct. The plan holds the convert type, channel count, widths, heights, formats, technique and linear flag. C copies it into the source as the setters do now. The technique crosses as an index into a static C-string table, with no allocation.
Plan (one PR, separate commits)
Behaviour-neutral move into libobs/obs-source-conversion-plan.c.h. After the move, init_gpu_conversion only fills the plan and copies it to the source.
Characterization test_async_conversion_plan, which pins the whole table. It covers every video_format plus two values outside the enum, × full_range, × every trc plus one outside. Sizes are 0, 1, 2, 3, odd, 1920 × 1080 and near UINT32_MAX. The near-UINT32_MAX cases are pinned as characterized, not endorsed.
RED, then GREEN: the safe Rust core plus shims in a libobs.ported-source-conversion-plan group. Exported symbols are unchanged.
Tier 3 parity against the original C: exhaustive over format × range × trc, plus a proptest over full u32 sizes, with the technique compared as a string. Also a deliberate-break check and port_comparison numbers.
These real-libobs tests must stay green on every lane: test_media_restart_first_frame, test_deinterlace_2x_field_order, and the PipeWire camera NV12 test.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2062.
obs-source: Port the async video GPU conversion plan (obs-rust#2113)