Closed
Labels
claimedAn agent or person has claimed this; check the claim comment before starting
Description
Unit
Port the source size query routing in libobs/obs-source.c.h to rust/obs-source, as a new module size_route. These decisions move:
get_async_width/get_async_height: the axis swap for a rotation that is not a multiple of 180. Since libobs: Keep an async rotation in 0-359 #2136, the stored rotation is in 0-359.get_base_width/get_base_height, which pick one route:- a transition reports its actual size while it is enabled, and 0 otherwise;
- a source with a size callback asks it (a filter, only while enabled);
- a filter without one asks its target;
- an async source reports its rotated frame size;
- anything else reports 0.
get_recurse_width/get_recurse_heightandobs_source_get_width/obs_source_get_height, which pick where to start: the first filter, the source itself, or (for a filter) itself.
These stay in C: data_valid, filter_mutex, the recursion into the target or the first filter, the get_width/get_height callbacks, and the fields each route reads.
Plan (one PR, separate commits)
- A behaviour-neutral move into
libobs/obs-source-size.c.h, as hidden functions. - Characterization in
test_source_size_route_steps. It covers:- every route for every combination of type, callback, filter, enabled and async;
- the swap for rotations 0, 90, 180, 270 and 45, and for raw
longvalues (-90, 360,LONG_MIN,LONG_MAX) as the core would see them; - the entry point for a filter, an input with and without filters, a transition and a scene.
- RED, then GREEN: the safe Rust core plus shims, in a
libobs.ported-source-sizegroup. Exported symbols are unchanged. - Tier 3 parity against the original C: exhaustive over the flags, plus a proptest over full
c_longrotations.longis 32-bit on Windows, so both widths are tested. Also a deliberate-break check andport_comparisonnumbers.
These real-libobs tests must stay green on every lane:
test_async_rotation_normalizetest_slideshow_sizetest_filter_color_spacetest_scene_item_croptest_scene_rotated_scale_filter- the transition size tests
Metadata
Metadata
Assignees
Labels
claimedAn agent or person has claimed this; check the claim comment before starting
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 24, 2026
Claiming: #2149.
libobs: Move the source size query routing into obs-source-size.c
test: Characterize the source size query routing
obs-source: Add Tier 1 tests for the source size query routing port
obs-source: Port the source size query routing
obs-source: Check the source size query routing port against the C
docs: Record the source size query routing port
obs-source: Port the source size query routing (obs-rust#2171)