Repository navigation
Closed
Labels
enhancementNew feature or requestportPort a C unit to Rust (four-tier policy)readyMeets the definition of Ready; claimable
Description
Unit
libobs/obs-output.c.h: the pause plan of obs_output_pause(), obs_encoded_output_pause() and obs_raw_output_pause() (the gates, which encoders' pause records are locked and in what order, the all-or-nothing check over the records, the pause time snapped to the video frame grid, and the start time or the end and offset each record gets), moved to libobs/obs-output-pause.c.h and ported to rust/obs-output (module output_pause, next to output_reconnect and output_slots).
Phase and position
Phase 2 libobs core, outputs (core-output group), after the output reconnect policy port (#2990, merged). Tracking: #4.
Dependencies and existing tests
- Depends on nothing open; the output reconnect, start, stop and slots ports have merged.
- No characterization yet:
test_output_pause_steps(cmocka, the moved file on its own) lands first, pinning pause and unpause with one video and two audio encoders (times and offset), one encoder whose record isn't clear (the whole pause fails and no record changes), an encoded output with audio encoders only (always fails: characterized, not endorsed), a raw output, the three refusal gates, and the grid snap forlast_video_ts0, a clock on the grid and one frame past it.
Notes
- What moves are the decisions on plain values: whether the output can pause, the already-in-that-state answer, which slots' records are locked, the pause time from the last video timestamp, the clock and the frame interval, whether a record can start or stop a pause, and the end time and offset a record gets.
obs-output.ckeepsobs_output_valid(), every atomic load and store onactiveandpaused, everypause.mutexlock and unlock (in the order the core marks, released in reverse),os_gettime_ns()and the read of the frame interval where they are,get_first_video_encoder_index(), the record stores, thepause/unpausesignals and the log. Each read stays where it is. - Intentional differences, fixed in the port and listed in its parity test:
- One encoder can sit in two audio slots (or two video slots): the setters check only the slot being set.
obs_encoded_output_pause()then locks the same encoder's plainpause.mutextwice and the caller hangs. The port locks, checks and updates each distinct encoder once. - The pause time divides by
obs->video.video_frame_interval_ns, which stays 0 until video is first set up, so a raw output that can pause in a host that never reset video divides by zero. The port uses the clock as the pause time when the interval is 0.
Both are reachable only from plugins, scripts and libobs hosts; the frontend sets one encoder per slot and always resets video.
- One encoder can sit in two audio slots (or two video slots): the setters check only the slot being set.
- Threads: the encoders' own pause checks (
video_pause_check,audio_pause_check) read these records under the same mutexes; the core holds no state and is asked under the locks C already holds.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestportPort a C unit to Rust (four-tier policy)readyMeets the definition of Ready; claimable
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Oct 30, 2026
Claiming: #3020.
Draft PR once the RED commit exists, today.
libobs: Move output pause plan to own file
test: Characterize the output pause plan
obs-output: Add Tier 1 tests for pause port
obs-output: Port the output pause plan
obs-output: Check the pause port against the C
docs: Record the output pause port
libobs: Test pause record fields one at a time
obs-output: Scale pause Tier 1 cases by CI level
rdoupe commentedon Oct 30, 2026
Fixed by the output pause plan port (PR #3024, merged): the pause decisions of
obs-output.c(which encoders' pause records are locked and updated, the pause time on the video frame grid, each record's start, end and offset) now run in Rust asrust/obs-outputoutput_pause, with the two intentional differences (each distinct encoder locked once; a frame interval of 0 uses the clock as the pause time).Left: nothing of this unit. The encoders' own pause checks (
video_pause_check()andaudio_pause_check(), which read the records this port writes) are the next unit, tracked in #3033.obs-output: Port the output pause plan (obs-rust#3024)