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 obs-service capability and connect-info getters to obs-output (#1846 unit 8, slice 1) #1899
#1846 unit 8, first slice: the service capability and connect-info getters in libobs/obs-service.c.h (lines 372–466, about 95 lines) → rust/obs-output.
obs_service_get_supported_resolutions
obs_service_get_max_fps
obs_service_get_max_bitrate
obs_service_get_supported_video_codecs
obs_service_get_supported_audio_codecs
obs_service_get_protocol
obs_service_get_preferred_output_type
obs_service_get_connect_info
obs_service_can_try_to_connect
Create, destroy, update, the reference counts and activate/deactivate stay C in this slice. They use obs_context_data (signals, hotkeys, the object list), which belongs to the #444 seam.
Why a slice, not the whole file
#1846 calls obs-service.c.h "public API only", but the getters read the private struct obs_service (service->info.<callback>, service->context.data). So the Rust needs a small exported-to-Rust C accessor: obs_service_info_ptr(service) plus the context data pointer, kept in C next to the struct layout. Rust then does the null checks, out-parameter zeroing and callback dispatch against struct obs_service_info, the public plugin ABI in obs-service.h, mirrored #[repr(C)].
Behavior to keep (characterized, not endorsed where marked)
A null service logs through obs_service_valid and returns NULL / false / nothing, for every getter that checks.
obs_service_get_supported_video_codecs and ..._audio_codecs do not check for a null service and dereference it (characterized, not endorsed; Tier 2 does not call them with NULL).
obs_service_get_protocol calls get_protocol without a NULL check (registration requires it).
get_max_bitrate zeroes both out-parameters before validating the service; get_max_fps and get_supported_resolutions validate first, then zero.
can_try_to_connect returns true when the plugin has no callback.
Plan
Characterization: test/cmocka/test_service_getters.c registers a fake obs_service_info with each callback present and absent, and pins every row above through OBS::libobs. It lands first, against the C.
RED: the Rust module obs-output/src/service.rs with todo!() stubs, plus Tier 1 tests.
GREEN: the port, the C accessor, and moving the getters into a ported-* group in libobs/build/source-sets.json. Tier 3 differential against the C oracle in rust/obs-c-oracle/legacy/. Record port_comparison.
The next slice (create/destroy/refs) is filed here when this one lands.
Claiming: #1846 unit 8, slice 1, the service getters. 1. Characterization cmocka test against the C (its own PR, first). 2. RED: Rust stubs plus Tier 1 tests. 3. GREEN: the port, the C accessor and the source-sets move, with Tier 3. The first PR is expected today.
Activity
zackees commentedon Oct 23, 2026
Claiming: #1846 unit 8, slice 1, the service getters. 1. Characterization cmocka test against the C (its own PR, first). 2. RED: Rust stubs plus Tier 1 tests. 3. GREEN: the port, the C accessor and the source-sets move, with Tier 3. The first PR is expected today.
test: run the service getter cases on one libobs and fail instead of …
obs-output: RED: service getter core stubs and Tier 1 tests (#1899)
obs-output: service getter safe core (#1899)
libobs: swap the obs-service getters for the obs-output port (#1899)
obs-c-oracle: port_comparison for the obs-service getters (#1899)
test: characterize the obs-service capability and connect-info getters (
test: run the service getter cases on one libobs and fail instead of …
obs-output: RED: service getter core stubs and Tier 1 tests (#1899)
obs-output: service getter safe core (#1899)
libobs: swap the obs-service getters for the obs-output port (#1899)
obs-c-oracle: port_comparison for the obs-service getters (#1899)
test: characterize the obs-service capability and connect-info getters (
test: run the service getter cases on one libobs and fail instead of …
4 remaining items
obs-c-oracle: port_comparison for the obs-service getters (#1899)
test: characterize the obs-service getters before the Rust port (obs-…
obs-output: RED: service getter core stubs and Tier 1 tests (#1899)
obs-output: service getter safe core (#1899)
libobs: swap the obs-service getters for the obs-output port (#1899)
obs-c-oracle: port_comparison for the obs-service getters (#1899)
obs-output: RED: service getter core stubs and Tier 1 tests (#1899)
obs-output: service getter safe core (#1899)
libobs: swap the obs-service getters for the obs-output port (#1899)
obs-c-oracle: port_comparison for the obs-service getters (#1899)
obs-output: port the obs-service getters to Rust (obs-rust#1899) (obs…
zackees commentedon Oct 23, 2026
Done: Tier 2 characterization #1901, port #1904 (merged). Next slices: #1913, #1920.