Skip to content

vlc-video: Host code behind vlc-video-host.h (#857) - #1248

Merged
zackees merged 2 commits into
masterfrom
facade/857-vlc-video-host
Oct 17, 2026
Merged

zackees merged 2 commits into
masterfrom
facade/857-vlc-video-host

Conversation

@zackees

@zackees zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Closes #857 (part of #847).

Moved behind plugins/vlc-video/vlc-video-host.h

Was (shared file, #ifdef) Now
load_libvlc_module() registry lookup of InstallDir\libvlc.dll (_WIN32) vlc_host_open_libvlc() in vlc-video-host-windows.c.h
/Applications/VLC.app paths, VLC_PLUGIN_PATH, libvlccore.dylib preload (__APPLE__) vlc_host_open_libvlc() in vlc-video-host-macos.c.h
libvlc.so.5 default vlc_host_open_libvlc() in vlc-video-host-posix.c.h
libvlc_core_module global + dlclose in obs_module_unload (__APPLE__) vlc_host_unload() (macOS closes libvlccore, others no-op), still called before libvlc_module is closed
add_file /→\ for non-URLs (_WIN32) vlc_host_native_path() (Windows only rewrites)
<windows.h> in vlc-video.pch.h (_WIN32) build/vlc-video-windows.pch.h

Each host file has its own unity group (build/vlc-video.{windows,macos,posix}+.h.c) and PCH; CMakeLists.txt picks the group by PLATFORM_ID like decklink. Behaviour is unchanged (same return-NULL/false paths, same unload order).

Documented exception: the _MSC_VER ssize_t typedef in vlc-video-plugin.h stays. libvlc_media.h needs it and every TU (the shared core group) includes that header, so it cannot move into a Windows-only group header.

Baseline delta (ci/platform-ifdef-baseline.json, regenerated with --update)

  • plugins/vlc-video/build/vlc-video.pch.h: 2 → 0
  • plugins/vlc-video/vlc-video-plugin.c.h: 4 → 0
  • plugins/vlc-video/vlc-video-source.c.h: 1 → 0
  • plugins/vlc-video/vlc-video-plugin.h: 1 (the ssize_t exception)

Total for vlc-video: 8 → 1.

RED / GREEN

  • RED (first commit): new test/cmocka/test_vlc_host_path.c (+ tests.d/test_vlc_host_path.cmake, Linux only) compiles vlc-video-host-posix.c.h on its own against a stub that drops the path: rust/tools/linux-validate/run.sh --repeat 1 → test_vlc_host_path ... Failed (test_vlc_host_path.c:20).
  • GREEN: run.sh --repeat 1 --tests 'vlc' → 279/279 passed, including test_vlc_host_path, test_vlc_audio_pacing, test_vlc_audio_track, test_vlc_channel_order, test_vlc_drain_gate, test_vlc_playlist_gap.
  • The Windows /→\ conversion is not unit-tested on Linux: its file needs <windows.h>.
  • ./lint rc=0.

What CI must verify

The macOS and Windows host groups were not compiled locally. ci/ci_scope.py selects the macOS and Windows lanes for this change, so PR CI is the only compile check for vlc-video-host-macos.c.h and vlc-video-host-windows.c.h.

Adds vlc-video-host.h and a stub POSIX host that the new cmocka test
test_vlc_host_path compiles on its own; the stub drops the path, so the
test fails until the host code moves.
The libVLC lookup (Windows registry, macOS VLC.app with libvlccore and
VLC_PLUGIN_PATH, libvlc.so.5 elsewhere), the macOS libvlccore unload and
the Windows path separator rewrite move to vlc-video-host-{windows,macos,
posix}.c.h, each in its own unity group and PCH that CMake picks per OS.
The shared files and the core PCH lose their conditionals. The MSVC
ssize_t shim in vlc-video-plugin.h stays: every TU includes that header
for libvlc_media.h.
@zackees
zackees enabled auto-merge October 17, 2026 13:34
@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

Local run note: the GREEN run.sh was killed by a 1500 s wrapper timeout (rc=124) partway through a third pass. Results before that: full suite 279/279, vlc-only 6/6, and the six vlc tests (incl. test_vlc_host_path) passed again in the third pass. No test failed; PR CI is the complete run.

@zackees

zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

Update: the third full pass did complete after the wrapper timed out (the tests kept running and logged their summary): 279/279. So all GREEN passes passed: 279/279, 6/6 (vlc), 279/279.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

facade: plugins/vlc-video: move 7 platform conditionals behind a per-platform layer

1 participant