Repository navigation
Description
Unit
New libobs/obs-audio-seam.h / libobs/obs-audio-seam.c.h (live C in libobs.core-output): the core-audio seam, so the coming port of libobs/obs-audio.c.h (the audio tick's per-source helpers and audio_callback) to a new rust/obs-core-seam can reach the core's audio, data and video fields and a source's audio fields without the struct layouts of obs-internal.h.
Each accessor is a single read, write, lock or container call, copied from the line of obs-audio.c.h it wraps:
- The core audio (
obs->audio): the outputaudio(403-404);render_ordernum, get, find, push and clear (27, 30, 56, 58, 66, 334-335, 409, 480-481);root_nodesnum, get, push and clear (72, 410, 454, 541-542);buffered_timestampspush back, peek front and pop front (412-413, 575);get_buffering, which fills astruct obs_audio_bufferingas 220-226 do;fixed_buffer(526);buffering_wait_ticksget and set (540, 579-580);monitoring_duplicating_source(359, 375, 380, 384);task_mutexlock and unlock,taskssize and pop front (341-349). - The core data and video:
first_audio_source,audio_sources_mutexlock and unlock (299, 315, 466-476, 520-522, 558-569);video.mixes_mutexlock and unlock, the mix count, a mix'sviewandmix_audio(425-464); a view'schannels_mutexlock and unlock and a channel (440-462). - A source:
next_audio_source;audio_buf_mutexlock and unlock;audio_is_duplicatedget and set;audio_pendingget and set;audio_ts;audio_input_buf[0].size;get_input, which fills astruct obs_audio_inputas 105-112 do;info.type,info.output_flagsand whetherinfo.audio_renderis set;audio_output_buf;muted,volumeandaudio_mixers;monitoring_enabled(an atomic load, 374).
None checks its arguments or takes a lock of its own: a caller takes audio_buf_mutex, audio_sources_mutex, mixes_mutex, channels_mutex and task_mutex where obs-audio.c.h takes them today, and the header comment lists them. Hidden in libobs (not EXPORT), like the transition seam's accessors. No C caller changes: obs-audio.c.h keeps its direct reads until the port replaces them.
Phase and position
Phase 6 (libobs core), the "internal accessors or adapter seams" item of the Phase 6 tracker (#444); tracking issue #4. It comes before the port of obs-audio.c.h. The extraction of the tick helpers into their own file was dropped (recorded on #444: test_audio_buffering_subsample compiles obs-audio.c.h and calls them by name), so the helpers and audio_callback are ported together after this seam.
Dependencies and existing tests
- None on master: the seam is new C in a new file. The decisions it serves are already Rust (
audio_discard,audio_min_ts,audio_mix,audio_renderinobs-core). - Nothing tests these accessors yet. A characterization test,
test/cmocka/test_audio_seam.c, builds the seam into itself (the accessors are hidden) over a stand-in core and stand-in sources, astest_source_transition_seam_callsdoes. It pins each read against the field it wraps, each write read back, each lock as onepthread_mutex_*result, and the container calls againstda_*/deque_*on the same fields.
Notes
No behaviour change and no Rust: the port calls these. The seam file stays live C, like the transition seam, and never moves into a ported group. The export sets of the C, hybrid and C reference builds stay identical, with the new accessors local.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Nov 8, 2026
Claiming: #4046
Plan, one PR (no Rust, no behaviour change), as the transition seam's calls went in:
libobs: Stub the core-audio seam:libobs/obs-audio-seam.hdeclares the accessors (hidden, notEXPORT; the header comment lists the locks callers take),libobs/obs-audio-seam.c.hhas stub bodies, included inlibobs.core-output+.h.candlibobs.pch.h.test/cmocka/test_audio_seam.cbuilds the seam into itself over a stand-in core and sources, registered intest-graph.json; it fails on the stubs.libobs: Add the core-audio seam: each body copied from the line ofobs-audio.c.hit wraps; the test passes. Then the C tests OFF and ON and the C, hybrid and C-reference export sets compared (the accessors local).Draft PR once the stub commit exists, today.
libobs: Stub the core-audio seam
libobs: Add the core-audio seam
rdoupe commentedon Nov 8, 2026
Closed by the merge of PR #4048 (the core-audio seam):
libobs/obs-audio-seam.handlibobs/obs-audio-seam.c.hare in as live C inlibobs.core-output, 53 hidden accessors, each copied from the line ofobs-audio.c.hit wraps, pinned bytest/cmocka/test_audio_seam.c. No Rust and no behaviour change; the export sets of the C, hybrid and C-reference builds are unchanged.What's left: the port of
libobs/obs-audio.c.hitself (the tick's per-source helpers andaudio_callback, ported together) torust/obs-core-seam, reaching the core and sources through this seam. No issue exists for it yet; it will be filed under the Phase 6 tracker (#444) as the next unit, andobs-audio.c.hkeeps its direct reads until then.libobs: Add the core-audio seam (obs-rust#4048)