Repository navigation
Description
Rust port, round 12 unit 1: the monitoring, monitor-only mute, balance, mixer, flag, push-to and audio-active decisions left in libobs/obs-source.c.h, moved to obs-source next to ptm_gate and volume_apply.
Unit
libobs/obs-source.c.h (the decisions only) to rust/obs-source, new module monitoring.
Phase and position
Phase 6 (libobs core), the core-source+ group. After the transition load checks (#2595), the last unit in this group.
Dependencies and existing tests
Rust takes over these decisions, on plain values:
obs_source_set_flags(): store and signal only on a change;obs_source_set_audio_mixers()and_get_audio_mixers(): the audio gate (owns_info_id, orOBS_SOURCE_AUDIOin the output flags), the same-value return, and the handler'sint64stored as(uint32_t);obs_source_enable_push_to_mute()and_push_to_talk(): the changed rule and the log rule (an audio source, and changed);obs_source_set_monitoring_enabled(): the same-value return, the deprecated type sent on theaudio_monitoringsignal (none; on and muted is Monitor Only; else Monitor and Output, bug: obs-websocket: SetInputAudioMonitorType "Monitor Only" plays into the stream on 33.0 (follow-up of #2444) #2447), the stored type, and whether the monitor is created or destroyed;obs_source_set_monitoring_type(): the steps per type (bug: libobs: 32.x "Monitor Only" sources play into the stream after the 33.0 upgrade #2444, bug: obs-websocket: SetInputAudioMonitorType "Monitor Only" plays into the stream on 33.0 (follow-up of #2444) #2447): none turns off, then unmutes only a mute Monitor Only set that is still on, then clears the flag; Monitor Only mutes if not muted (and marks it), turns on, stores the flag; Monitor and Output unmutes and turns on; any other value turns on;obs_source_get_monitoring_type(): none when off, else Monitor Only when muted;clamp_balance(): NaN is 0.5, else clamped to [0, 1], on the value sent and on the value a handler leaves (bug: libobs: push-to-talk delays can wrap and the audio balance isn't range-checked #2051);obs_source_set_audio_active(): signal only when the previous value differs, and which signal.
C keeps obs_source_valid(), audio_mutex, every os_atomic_* (read where it is today), every calldata_*, signal and log (the deprecation warnings included), obs_source_set_muted()/obs_source_muted(), audio_monitor_create()/_destroy(), the getters' literals for an invalid source, and everything of the volume and the push-to gate (already Rust).
Existing real-libobs tests: the Monitor Only tests from #2444 and #2447 and the balance test from #2051. A characterization test of the moved decisions (test_source_monitoring_steps) lands first.
Notes
- Concurrency: each decision is its own function, asked at its own point.
obs_source_set_monitoring_type()readsmonitor_only_mutedonce and the mute after each call it makes; C keeps both reads there and asks the core after each, so the core never assumes a mute it asked for has happened. Monitor Only mutes before it turns monitoring on. - Handlers of
audio_balanceandaudio_mixersmay change the value: C keeps the signal and asks the core again with what the handler left. - No SIMD, no per-OS code, no struct mirrored, no pointer crosses. The monitoring type crosses as
int, checked with_Static_assert. - Expected intentional differences: none.
Plan
The standard six commits:
- move (behaviour-neutral);
- characterization test;
- Tier 1 RED;
- GREEN in a
libobs.ported-source-monitoringgroup; - Tier 3 parity;
- docs.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 27, 2026
Claiming: #2621 (round 12 unit 1, source monitoring, monitor-only mute and balance rules).
libobs/obs-source-monitoring.c.h(hidden, declared inobs-source-monitoring.h), behaviour-neutral, checked with a harness against master's functions.test_source_monitoring_steps.todo!().rust/obs-sourcemonitoringand its shims, in a newlibobs.ported-source-monitoringgroup.Draft PR once the RED commit exists, today.
libobs: Move the source monitoring decisions
test: Characterize the source monitoring rules
obs-source: Test the monitoring port
obs-source: Port the source monitoring rules
obs-source: Check monitoring against the C
docs: Record the source monitoring port
rdoupe commentedon Oct 27, 2026
Fixed by #2629 (merged as 7ba13d0): the monitoring, monitor-only mute, balance, mixer, flag, push-to and audio-active decisions left in
libobs/obs-source.c.hnow live inrust/obs-source(modulemonitoring), behind thirteen hidden C-ABI functions. Tier 1, the characterization test, Tier 3 parity and the mutation check all pass; exported symbols are unchanged and there are no intentional differences.Nothing is left of this unit, so there is no follow-up issue for it. Unrelated, found on the way: the Windows-GNU oracle build failing under
-Wconversioninaudio-math.h(#2648) is tracked and fixed separately.obs-source: Port the source monitoring rules (obs-rust#2629)