Repository navigation
Closed
Labels
claimedAn agent or person has claimed this; check the claim comment before starting
Description
Inventory of platform conditionals in shared-named files of plugins/obs-ffmpeg/ (25 #ifs in 7 files; no existing per-platform C files besides vaapi/mediacodec-specific units).
| file | lines | macro | what the branch does |
|---|---|---|---|
obs-ffmpeg.c |
7 | _WIN32 |
INITGUID + dxgi.h include |
| 12 | !_WIN32 && !__APPLE__ |
VAAPI utils include and LIBAVUTIL_VAAPI_AVAILABLE |
|
| 126 | _WIN32 |
nvenc_device_available() via DXGI adapter enumeration |
|
| 184 | __linux__ |
get_id_from_sys / sysfs GPU probing for VAAPI |
|
| 257, 259 | _WIN32, __linux__ |
NVENC availability check per OS (Linux dlopens libnvidia-encode) |
|
| 326, 377, 426 | _WIN32 && !_M_ARM64 |
AMF amf_load/amf_unload declarations and calls |
|
obs-ffmpeg-mux.c |
21 | _WIN32 |
win-version.h include |
| 113 | _WIN32 |
helper exe name obs-ffmpeg-mux(.exe) |
|
| 318 | _WIN32 |
Windows 10 Defender warning on mux start failure | |
ffmpeg-mux/ffmpeg-mux.c |
17, 1134, 1147, 1195 | _WIN32 |
io.h/windows.h, wmain with wide argv conversion and cleanup, SetErrorMode |
| 658 | _MSC_VER |
disable warning 4996 | |
obs-ffmpeg-srt.h |
23, 814, 864 | _WIN32 |
ftime vs gettimeofday style timestamp |
| 485 | _WIN32 |
gai_strerrorA vs gai_strerror |
|
obs-ffmpeg-url.h |
31, 35, 95 | _WIN32 |
syslog definitions vs <syslog.h> for SRT headers |
obs-amf-test/obs-amf-test.cpp |
19 | _MSC_VER |
export AmdPowerXpressRequestHighPerformance |
Proposed facade
plugins/obs-ffmpeg/platform.h implemented by platform-windows.c, platform-linux.c, platform-mac.c (empty/no-op):
ffmpeg_platform_nvenc_device_available()(merges the 126 and 257/259 branches)ffmpeg_platform_vaapi_available(),ffmpeg_platform_load_hw_backends()/unload_...()(AMF load/unload, 326/377/426)ffmpeg_platform_mux_exe_name(),ffmpeg_platform_mux_start_hint(path)(Defender warning)ffmpeg_platform_wall_clock_seconds()andffmpeg_platform_gai_strerror()for SRT (or useutil/platform.h)ffmpeg-mux/has its own entry point; putwmainwrapper inffmpeg-mux/main-windows.cand keep a portableffmpeg_mux_main(argc, argv).
Likely must stay
_MSC_VERpragma-only blocks (ffmpeg-mux.c:658,obs-amf-test.cpp:19export symbol): compiler/export selection; document as exceptions or move to the test's Windows-only source.obs-ffmpeg-url.h31/35/95: shim for the bundled SRT headers; move into aplatform/include only if SRT headers can be wrapped.- CMake
OS_LINUX OR OS_WINDOWSblocks (CMakeLists.txt:6,78,cmake/dependencies.cmake:15,18) stay.
Test approach
Behaviour-preserving moves. Verify with: the plugin's native builds on each platform (ci-full label, since these are outside the quick gate), the existing cmocka tests where the moved function is testable, and ./lint. Where a facade function is pure (path/name/constant selection) add a small unit test per platform implementation. The #847 ratchet lint baseline must go down by the count moved.
Part of #847.
Metadata
Metadata
Assignees
Labels
claimedAn agent or person has claimed this; check the claim comment before starting
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 24, 2026
Claiming: #853, one PR per slice, following the #1292/#882 host-interface pattern (conditional-free
*-host.h,*-host-{windows,macos,posix}in per-OS unity groups, cmocka RED test, cross-check coverage):obs-ffmpeg-mux.c.hand its PCH: helper executable name, Defender hint,win-version.hinclude.ffmpeg-mux/helper:wmainwrapper andSetErrorModeinto a Windows entry file, plus the_MSC_VERpragma moved to CMake.obs-ffmpeg.c.hand its PCH: NVENC/VA-API availability, AMF load/unload.obs-ffmpeg-srt.h/obs-ffmpeg-url.hand the AMF PCH.The first PR (RED) goes up today.
obs-ffmpeg: RED test for the muxer output host interface (#853)
obs-ffmpeg: muxer output host code behind obs-ffmpeg-mux-host.h (#853)
test: link the mux host into the tests that build obs-ffmpeg-mux.c (#853
obs-ffmpeg: muxer output host code behind obs-ffmpeg-mux-host.h (obs-…
obs-ffmpeg: ffmpeg-mux Windows host PCH includes stdio.h (#853)
obs-ffmpeg: ffmpeg-mux host files include their PCH (#853)
test: obs-ffmpeg host test does not assume the machine has no NVIDIA …
test: obs-ffmpeg host test comment matches its checks (#853)
test: obs-ffmpeg host test comment matches its checks (#853)
test: obs-ffmpeg Linux/POSIX hosts gate NVENC on the encode library (#…
obs-ffmpeg: NVENC device check and AMF load behind obs-ffmpeg-host.h (#…
test: obs-ffmpeg host test does not assume the machine has no NVIDIA …
test: obs-ffmpeg host test comment matches its checks (#853)
test: obs-ffmpeg host test comment matches its checks (#853)
obs-ffmpeg: ffmpeg-mux helper entry points behind ffmpeg-mux-host.h (o…
obs-ffmpeg: NVENC device check and AMF load behind obs-ffmpeg-host.h (o…
test: obs-ffmpeg POSIX network host header (#853)
obs-ffmpeg: SRT/URL host code behind hosts/<os>/obs-ffmpeg-net-host.h…
cmake/cross: obs-ffmpeg-cross finds the host's obs-ffmpeg-net-host.h (#…
zackees commentedon Oct 24, 2026
Done: all 25 obs-ffmpeg platform conditionals are behind host files, and
ci/platform-ifdef-baseline.jsonhas noplugins/obs-ffmpegentries left. Slices: #2023 (muxer output host), #2042 (ffmpeg-mux helper entry points), #2050 (NVENC device check, AMF load, VA-API define), #2068 (SRT/URLhosts/<os>/obs-ffmpeg-net-host.h, AMF PCH renamed for its Windows group). Each has a Tier 2 test that runs the POSIX hosts on Linux, plus cross check entries. Nothing left.obs-ffmpeg: SRT/URL host code behind hosts/<os>/obs-ffmpeg-net-host.h…