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 output video size, conversion and capture checks in obs-output.c to obs-output #2067
Port the output video size, conversion and capture checks in libobs/obs-output.c.h to rust/obs-output, as a new module video_checks:
get_first_mixer: the lowest set bit of mixer_mask below MAX_AUDIO_MIXES, else 0;
obs_output_get_width2 / obs_output_get_height2: an encoded output asks its encoder, a raw output takes scaled_* or the video size;
video_valid, audio_valid and can_begin_data_capture: the flag and presence checks;
has_scaling and obs_output_get_video_conversion: the set conversion (a 0 width or height is filled from the output size), the scaled size, or none;
the delay-active and active gates in obs_output_can_begin_data_capture, before the join;
obs_output_get_congestion: the 0–1 clamp.
These stay C: obs_output_valid, the log_flag_* warnings, the pthread_join, obs_encoder_get_width/_height, video_output_get_* and info.get_congestion. C reads the fields and atomics and passes plain values.
Plan (one PR, separate commits)
A behaviour-neutral move into libobs/obs-output-video-checks.c.h, as hidden functions over a plain struct.
Characterization: test_output_video_checks_steps. It covers:
first_mixer for 0, single bits, several bits, and bits at or above MAX_AUDIO_MIXES;
each output flag × each presence bit;
the conversion cases;
congestion at -1, 0, 0.5, 1, 2, ±inf and NaN.
RED, then GREEN: the safe Rust core plus shims, in a libobs.ported-output-video-checks group. Exported symbols are unchanged.
Tier 3 parity against the original C: exhaustive over flags and presence bits, plus proptests over u32 sizes, mixer masks and f32 bit patterns. Then a deliberate-break check and port_comparison numbers.
These real-libobs tests must stay green on every lane: test_raw_output_video_reset, test_scaled_mix_alpha, test_texture_encoder_raw_format, test_output_start_twice, test_output_failed_start_encoders, test_output_null_id and test_encoding_lag_rescale.
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2067.
obs-output: Port the output video size, conversion and capture checks (…