Repository navigation
Description
Inventory of platform conditionals in shared-named files of plugins/obs-outputs/ (34 #ifs in 8 files; excludes vendored librtmp/). Existing per-platform files: rtmp-windows.c, net-if.c calls netif_get_addrs_win32/_nix.
| file | lines | macro | what the branch does |
|---|---|---|---|
rtmp-stream.c |
27 | _WIN32 |
include win-version.h |
| 256 | _WIN32 |
last socket error: WSAGetLastError() vs errno |
|
| 278 | _WIN32+test macro |
framedrop test shortcut code (dev-only) | |
| 347 | _WIN32 |
socket_queue_data callback (new socket loop) |
|
| 388 | _WIN32 |
ioctlsocket(FIONREAD) vs ioctl(FIONREAD) |
|
| 506 | _WIN32 |
map WSA error codes to user messages | |
| 576 | __linux__ |
append root-certificate hint to error text | |
| 619, 639, 710 | _WIN32 |
log_sndbuf_size() definition (+socklen_t typedef) and its two call sites |
|
| 996 | _WIN32 |
set socket non-blocking: ioctlsocket(FIONBIO) vs fcntl |
|
| 1063 | _WIN32 |
new socket loop: unsupported-platform error on non-Windows | |
| 1095, 1215 | _WIN32 |
win32_log_interface_type() and its call |
|
| 1486, 1956, 1993 | _WIN32 |
new-socket-loop / low-latency settings read, defaults, UI properties | |
rtmp-stream.h |
12, 146 | _WIN32 |
Iphlpapi.h vs sys/ioctl.h; socket_thread_windows prototype |
net-if.c |
52 | _WIN32 |
inet_ntop path vs Windows address formatting |
| 115 | _WIN32 |
WSAStringToAddressA vs inet_pton |
|
| 136 | _WIN32 |
is_loopback(struct ifaddrs*) helper (nix only) |
|
| 260 | _WIN32 |
dispatch to netif_get_addrs_win32 / _nix |
|
net-if.h |
22, 29, 31, 47 | _WIN32 __linux__ __FreeBSD__ |
socket/ifaddrs headers, _GNU_SOURCE fiddling |
obs-outputs.c |
3, 21, 54, 59, 73 | _WIN32 |
WSAStartup/cleanup and mbedTLS threading shims (mbed_mutex_*) |
mp4-mux-internal.h |
201 | _WIN32 |
min() fallback helper for non-Windows |
utils.h |
13 | _MSC_VER |
clz32 MSVC intrinsic variant |
Proposed facade
New plugins/obs-outputs/platform.h (shared API) with platform-windows.c (extend existing rtmp-windows.c) and platform-nix.c:
rtmp_socket_last_error(),rtmp_socket_set_nonblocking(sock),rtmp_socket_bytes_available(sock, &n),rtmp_socket_error_message(code)rtmp_net_startup()/rtmp_net_shutdown()(WSAStartup + mbedTLS threading on Windows, no-op elsewhere)rtmp_log_socket_details(stream)(sndbuf size, interface type)netif_parse_address()/netif_format_address();netif_get_addrs()already has per-platform backends, so call it through the facade and drop the dispatch#ifrtmp_stream_platform_defaults(defaults),rtmp_stream_platform_properties(props),rtmp_stream_platform_update(stream, settings)for the Windows-only new-socket-loop / low-latency options- move
socket_queue_dataandsocket_thread_windowsintortmp-windows.c
Likely must stay
net-if.h22/29/31/47: header selection and_GNU_SOURCEworkaround; move intoplatform.hper OS if possible, else keep as documented exception.utils.h13 (_MSC_VERintrinsic) andmp4-mux-internal.h201 (minfallback): compiler/libc feature selection; replace withutil/helpers or feature checks instead of an OS facade.rtmp-stream.c576 (__linux__hint text): can become a facade string getter, low value.- CMake
OS_WINDOWSblock (CMakeLists.txt:111) and/IGNORE:4098link options (108): the intended per-platform source selection mechanism, 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
Type
Projects
- StatusShow more project fieldsDone
Activity
zackees commentedon Oct 24, 2026
Claiming: #851 (obs-outputs platform facade), same pattern as the #853 slices (#2023/#2042/#2050/#2068): conditional-free
*-host.hinterfaces,*-host-<os>.c.horhosts/<os>/implementations with their own unity groups/PCHs, a Tier 2 test per slice that runs the POSIX hosts on Linux, cross check for Windows/macOS, baseline entries removed.net-if.c.h/net-if.h(interface enumeration, 13).rtmp-stream.c.h/.h+obs-outputs-rtmp.pch.h(socket send/low-latency/Windows send thread, 19).obs-outputs.c.h,obs-outputs.pch.h,mp4-mux-internal.h,utils.h(8).First PR (slice 1) within a day.
test: obs-outputs net-if with its POSIX host (#851)
obs-outputs: net-if host code behind net-if-host.h and hosts/<os>/net…
test: rtmp tests in test-graph.json also build the net-if POSIX host (#…
test: obs-outputs net-if with its POSIX host (#851)
obs-outputs: net-if host code behind net-if-host.h and hosts/<os>/net…
test: rtmp tests in test-graph.json also build the net-if POSIX host (#…
obs-outputs: net-if host code behind net-if-host.h and hosts/<os>/net…
test: obs-outputs RTMP output POSIX host (#851)
obs-outputs: RTMP output host code behind rtmp-stream-host.h (#851)
obs-outputs: RTMP host PCHs name netdb.h and iphlpapi.h, cross check …
test: obs-outputs module POSIX host and bit helpers (#851)
obs-outputs: module host behind obs-outputs-host.h, portable bit help…
obs-outputs: utils.h fallback bit helpers are static inline (#851)
obs-outputs: utils.h ctz32 fallback avoids unary minus on unsigned (M…
obs-outputs: RTMP output host code behind rtmp-stream-host.h (obs-rus…
test: obs-outputs module POSIX host and bit helpers (#851)
obs-outputs: module host behind obs-outputs-host.h, portable bit help…
obs-outputs: utils.h fallback bit helpers are static inline (#851)
obs-outputs: utils.h ctz32 fallback avoids unary minus on unsigned (M…
obs-outputs: module host behind obs-outputs-host.h, portable bit help…
zackees commentedon Oct 24, 2026
Done: all obs-outputs platform conditionals are behind host files, and
ci/platform-ifdef-baseline.jsonhas noplugins/obs-outputsentries left. Slices: #2076 (net-ifhost andhosts/<os>/net-if-os.h), #2092 (RTMP output host: socket errors/ioctls, root-cert hint, Windows send thread), #2096 (module host: Winsock/mbedtls threading; portable bit helpers;min_size). Each has a Tier 2 test running the POSIX host on Linux, and the host groups are in the cross check (obs-outputs had no entry before). Nothing left.