Repository navigation
Description
Port obs_source_output_video_internal() (declared without EXPORT in libobs/obs-internal.h, defined in libobs/obs-source.c.h) into obs-source. It is the last C one of the three async-frame internals the Rust wrappers in libobs/obs-source-frame-wrappers.c.h end in (#5760): obs_source_preload_video_internal() went to Rust in #5838 and obs_source_set_video_frame_internal() is in the queue as #5840. Nothing in the issue list or open PRs covers it. The frame-copy design investigation (#3201) changes what cache_video() copies; this unit leaves cache_video() in C, so it does not conflict.
Contract to keep:
obs_source_valid(source, "obs_source_output_video"): a NULL source logs oneLOG_DEBUGobs_source_output_video: Null 'source' parameterline (the public entry's name), return.- Under
audio_buf_mutexalone (not insideasync_mutex, bug: libobs: NDI audio with 100 ms frames drops out of the mix for minutes since #522 #3747):last_output_frame_ts= the frame's timestamp, or 0 for a NULL frame. - NULL frame: under
async_mutex,async_active= false,async_textures_stale= true,last_frame_ts= 0,free_async_cache(); return. - Otherwise
source_profiler_async_frame_received(), thencache_video(); then underasync_mutex, for a non-NULL result: decrement its refs; at 0 destroy it, otherwise push it ontoasync_framesand setasync_active= true. A NULL result (cache overflow) touches nothing more.
Stays C, behind a hidden non-EXPORT -fields.c.h adapter: obs_source_valid, the two mutexes, the atomics, free_async_cache(), cache_video() (and clean_cache()), the profiler call, the refs decrement, obs_source_frame_destroy() and the async_frames push.
Plan (shape of #5838/#5840): extract the body verbatim into its own file in the live core-source group; characterize with a new cmocka test through the public obs_source_output_video()/obs_source_output_video2() against hybrid libobs and the C reference (NULL source, NULL frame clears the queue and marks the textures stale, queued frames and async_active, last_output_frame_ts, cache reuse, the overflow at 30 queued frames drops the queue); Tier 1 RED against todo!() in obs-source's existing test binary; then the Rust swap with a Tier 3 differential against the original C recording every adapter call in order. No public-header, existing-C-test, WebSocket or workflow edits. Tier 4 does not apply.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
rdoupe commentedon Nov 27, 2026
Claiming: I'll port it in one PR, RED then GREEN, once #5840 merges (it edits the neighbouring lines of obs-source.c.h): extract, cmocka characterization, Tier 1 RED, then the swap with Tier 3 parity. Branch port/5841-output-video-internal.
libobs: extract obs_source_output_video_internal verbatim (Refs #5841)
test: characterize obs_source_output_video_internal (Refs #5841)
obs-source: Tier 1 for obs_source_output_video_internal, RED (Refs #5841
obs-source: port obs_source_output_video_internal to Rust, GREEN (Fixes
libobs: extract obs_source_output_video_internal verbatim (Refs #5841)
test: characterize obs_source_output_video_internal (Refs #5841)
obs-source: Tier 1 for obs_source_output_video_internal, RED (Refs #5841
obs-source: port obs_source_output_video_internal to Rust, GREEN (Fixes
obs-source: port obs_source_output_video_internal to Rust (Fixes obs-…