Skip to content

obs-qsv11: Host code behind qsv-host.h (#860) - #1263

Merged
zackees merged 2 commits into
masterfrom
facade/860-qsv-host
Oct 17, 2026
Merged

zackees merged 2 commits into
masterfrom
facade/860-qsv-host

Conversation

@zackees

@zackees zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Closes #860. Part of #847. Same shape as #1248 / #1252 / #1257.

Moved inventory

was now
obs-qsv11.c.h #ifdef _WIN32 texture check (handle vs tex[0]/tex[1]) qsv_host_texture_valid() in qsv-host-{windows,linux}.c.h (new C groups build/obs-qsv11.{windows,linux}-c+.h.c + PCHs)
QSV_Encoder_Internal.cpp.hpp #if _WIN32 D3D11 / VA-API accel mode + m_bUseD3D11/m_bUseTexAlloc qsv_host_select_accel_mode() in common_utils_{windows,linux}.cpp.hpp
QSV_Encoder_Internal.cpp.hpp #if _WIN32 video signal info ext buffer qsv_host_add_video_signal_info() (Windows fills it; Linux is a no-op, as before)
common_utils.h bits/{windows,linux}_defs.h selection #include OBS_QSV_HOST_DEFS, set per platform by CMake (plugin, obs-qsv-test, cmake/cross)

qsv-host.h is conditional-free apart from __cplusplus. Existing OS files stay where they are.

Baseline delta (ci/platform_ifdef_ratchet.py --update)

  • QSV_Encoder_Internal.cpp.hpp: 2 -> 0
  • common_utils.h: 2 -> 0
  • obs-qsv11.c.h: 1 -> 0
    Total -5.

RED / GREEN

  • RED (8fac5c8): new test/cmocka/test_qsv_host.c (Linux, compiles only qsv-host-linux.c.h, links libobs+cmocka) against a return false stub: test_both_planes fails; 280/281 others pass.
  • GREEN: test_qsv_host passes in both builds (linux-validate --repeat 1 --tests test_qsv_host). One unrelated failure in that run: test_vlc_playlist_gap (libobs-with-rust, 26 s VLC playback timing); it passed in the RED run with the same libobs code.

Not verified locally

  • The D3D11/session and video-signal moves are compile-only, with no Intel GPU here. The plugin is not built locally because there are no VPL headers. ci_scope selects windows=true and linux_targets=obs-qsv11, so PR CI is the first build of the Windows and Linux plugin.

Leftovers

  • common_directx11.h (3 findings: <windows.h>, <d3d11.h>, <dxgi1_2.h>) stays in the baseline. It is a Windows-only file, but the ratchet doesn't recognise its name. Renaming it is out of scope for this PR.
  • obs-qsv-test.cpp.hpp _MSC_VER exports are untouched. The ratchet doesn't flag them (the file isn't in the baseline), and the file is built only in the Windows group.

qsv-host.h declares the host interface; qsv-host-<os>.c.h are stubs in new
per-OS C unity groups. test_qsv_host pins the Linux check and fails against
the stub.
Moves the shared files' platform conditionals into per-OS host code:
- obs-qsv11.c.h texture validity -> qsv_host_texture_valid (qsv-host-<os>.c.h)
- QSV_Encoder_Internal D3D11/VA-API accel selection -> qsv_host_select_accel_mode
- Windows video signal ext buffer -> qsv_host_add_video_signal_info
  (both in common_utils_<os>.cpp.hpp)
- common_utils.h bits/<os>_defs.h selection -> OBS_QSV_HOST_DEFS from CMake
Baseline regenerated with --update.
@zackees
zackees enabled auto-merge October 17, 2026 16:18
@zackees
zackees added this pull request to the merge queue Oct 17, 2026
Merged via the queue into master with commit 2407790 Oct 17, 2026
29 checks passed
@zackees
zackees deleted the facade/860-qsv-host branch October 26, 2026 15:43
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/obs-qsv11: move 6 platform conditionals behind a per-platform layer

1 participant