Skip to content

obs-output: port the obs-service settings, properties and identity functions (#1913) - #1916

Merged
zackees merged 6 commits into
masterfrom
port/1913-service-settings
Oct 23, 2026
Merged

zackees merged 6 commits into
masterfrom
port/1913-service-settings

Conversation

@zackees

@zackees zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member

Refs #1913 (#1846 unit 8, slice 2). Stacked on #1904 (slice 1); retarget to master once it merges. Tier 2 characterization is #1914 (test_service_settings).

RED

3790521: todo!() stubs in obs_output::service plus Tier 1 (rust/obs-output/tests/output/service_settings.rs, the cases of test_service_settings.c against a fake host/type/service). All 7 fail: not yet implemented: #1913.

GREEN

  • 1f9c8bc safe core: display_name, defaults, type_properties (by id), name, type_id, id, type_data, properties, update, settings, apply_encoder_settings. Same check order and NULL-log names as the C.
  • f6650cb swap: moves obs_service_get_display_name, obs_service_defaults, obs_get_service_properties, obs_service_get_name, _get_type, _get_id, _get_type_data, _update, _get_settings, _properties, _apply_encoder_settings from obs-service.c.h into obs-service-getters.c.h (the ported group, dropped from hybrid libobs). It also adds the hidden obs_service_get_context_name() / _get_context_settings() accessors and the export names. The shims call find_service(), obs_data_* and obs_properties_apply_settings in libobs.
  • Out of scope, kept in C: obs_service_get_signal_handler / _get_proc_handler. No public header declares them (upstream quirk), so exporting them from Rust would add symbols that were never public API.

soldr cargo test -p obs-data --test obs-tests-core output::service: 19 passed (slice 1 and slice 2). ./lint: 0.

Tiers

  • Tier 1: 7 cases above.
  • Tier 2: test: characterize the obs-service settings, properties and identity functions (#1913) #1914, unchanged C test run against the hybrid libobs and libobs-c-reference.
  • Tier 3: service_settings_parity.rs runs every function on the Rust and the oracle C. Both sides share the same struct obs_service and find_service() table. It covers all 32 combinations of {get_defaults, get_properties, update, apply_encoder_settings, type_data}, a NULL service and a missing id. It compares returns, settings contents (real obs_data from the Rust crates) and the plugin call trace (including the properties' modified callback).
  • Tier 4: n/a.

port_comparison (Rust / C, ns)

get_name 4.69 / 2.07, get_id 3.98 / 2.33, get_display_name 6.64 / 6.33, apply_encoder_settings 4.68 / 5.69. On get_name / get_id, the ~2 ns gap is the wrapper fetching the info table and plugin data through two hidden accessor calls before it reads the field. The C reads the fields directly.

Not user-visible, no features.md line.

Seven Tier 1 cases from test_service_settings.c fail against todo!()
stubs: 'not yet implemented: #1913'.
…ons for the obs-output port (#1913)

Moves obs_service_get_display_name, _defaults, obs_get_service_properties,
_get_name, _get_type, _get_id, _get_type_data, _update, _get_settings,
_properties and _apply_encoder_settings into obs-service-getters.c.h behind
the hidden context accessors, exports the Rust shims, and adds the Tier 3
parity test against the oracle. GREEN: Tier 1 and Tier 3 pass.
@zackees
zackees force-pushed the port/1913-service-settings branch from 2491692 to 30aaff9 Compare October 23, 2026 09:06
@zackees
zackees changed the base branch from port/1899-service-getters to master October 23, 2026 09:06
@zackees zackees closed this Oct 23, 2026
@zackees zackees reopened this Oct 23, 2026
@zackees

zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Coordinator: Fast Gate fails in the export-list checks, not in the port itself:

rust/obs-util/tests/platform/export_list.rs:155 rust_exports_are_one_fragment_per_ffi_module
  left: {}
  right: {"obs_get_service_properties", "obs_service_apply_encoder_settings", "obs_service_can_try_to_connect", "obs_service_defaults", "obs_service_get_connect_info", "obs_service_get_display_name", …}
rust_exports_list_matches_no_mangle_shims (export_list.rs:199) also fails

The new #[no_mangle] service shims have no export fragment, so they are missing from libobs/cmake/rust-exports.map. Add a fragment for the new FFI module and regenerate the map, the same way #1842 did for its scene shims.

@zackees

zackees commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Fixup: the swap commit had emptied libobs/cmake/rust-exports.d/obs-output-service.txt, so the 20 moved functions were missing from the export list (obs-util rust_exports_list_matches_no_mangle_shims failed; Windows would not export them). Restored in the new top commit; the export tests pass locally.

@zackees
zackees added this pull request to the merge queue Oct 23, 2026
Merged via the queue into master with commit c65fffd Oct 23, 2026
33 checks passed
@zackees
zackees deleted the port/1913-service-settings branch October 26, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant