Repository navigation
obs-output: port the obs-service getters to Rust (#1899) - #1904
Merged
Merged
Conversation
zackees
force-pushed
the
port/1899-service-getters
branch
from
October 23, 2026 06:08
1b7eab0 to
92a5c99
Compare
zackees
marked this pull request as ready for review
October 23, 2026 06:34
zackees
force-pushed
the
port/1899-service-getters
branch
from
October 23, 2026 06:39
e30abd2 to
8482924
Compare
10 tasks done
zackees
force-pushed
the
port/1899-service-getters
branch
from
October 23, 2026 07:00
8482924 to
09bc1fd
Compare
This was referenced Oct 23, 2026
zackees
force-pushed
the
port/1899-service-getters
branch
from
October 23, 2026 07:27
09bc1fd to
b7f0815
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Oct 23, 2026
The nine exported getters move from obs-service.c.h to obs-service-getters.c.h in their own unity group, libobs.ported-service-getters, which the hybrid libobs replaces with the Rust shims in obs-output's ffi::service (rust-exports.d). struct obs_service stays C: the hidden obs_service_get_info_table() and obs_service_get_plugin_data() beside it give the C file and the shims the plugin's callback table and data. The shims mirror struct obs_service_info. Tier 3 (service_parity): the C oracle and the shims run on the same service over all 256 optional-callback tables with NULL and sentinel out-parameters, comparing returns, out-parameters and the plugin call trace; the mirror's size, alignment and 27 field offsets match the C. Mutants (can_try default false; video bitrate not zeroed) fail it. Refs #1899
zackees
force-pushed
the
port/1899-service-getters
branch
from
October 23, 2026 08:07
b7f0815 to
7a42744
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1899 (#1846 unit 8, slice 1). Stacked on #1901, the characterization (queued); its commits show here until it merges.
Commits
obs-output/src/service.rswithtodo!()stubs, plus Tier 1tests/output/service.rs, which mirrors every case oftest_service_getters.c. All 8 fail.max_bitratezero-before-check, and the C'sobs_ptr_validfunction and parameter names (obs_service_get_infofor connect info).obs-service.c.htoobs-service-getters.c.h, in a new grouplibobs.ported-service-getters(LIBOBS_PORTED_SOURCES). The hybrid libobs replaces the group with the shims inobs-output::ffi::service, which are exported throughrust-exports.d/obs-output-service.txt. The C reference keeps the C.struct obs_servicestays private to C. Two hidden accessors next to it,obs_service_get_info_table()andobs_service_get_plugin_data()(declared inobs-internal.h), give the C file and the shims the plugin's callback table and data.ObsServiceInfomirrors the publicstruct obs_service_info.service_parity.rs, againstrust/obs-c-oracle/oracle/service_getters.c, which compiles the unmodifiedobs-service-getters.c.hwithoracle_*names.struct obs_serviceover all 256 optional-callback tables, with NULL and sentinel out-parameters. Both sides must agree on return values, out-parameters and the plugin call trace (data pointer and arguments).can_try_to_connectdefault of false, and a video bitrate that isn't zeroed, both fail Tier 3.cargo bench -p obs-c-oracle --bench port_comparison -- service/, criterion median, this host):get_protocolget_connect_infocan_try_to_connect(no callback)get_max_bitrateThe getters are a few nanoseconds either way. The callers (stream start, settings) call them a handful of times.
Tiers
soldr cargo test -p obs-data --test obs-tests-core output::service)../lintis clean.test_service_getters(test: characterize the obs-service getters before the Rust port (#1899) #1901) through the hybrid and reference libobs, which PR CI runs. My local Tier 2 lane can't see new files in this clone's bind mount, which is an environment issue, not the change.Create, destroy, references and activation stay in C. That next slice gets filed on #1846 when this lands.