Skip to content

libobs: Move obs.c's host code into obs-windows.c, obs-cocoa.m and obs-nix.c - #1071

Closed
zackees wants to merge 1 commit into
masterfrom
facade/868-obs-c
Closed

zackees wants to merge 1 commit into
masterfrom
facade/868-obs-c

Conversation

@zackees

@zackees zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member

Fixes #868 (part of #847).

libobs/obs.c's 8 platform conditionals become five hooks declared in obs-internal.h, one implementation per host in the existing obs-windows.c, obs-cocoa.m and obs-nix.c (Linux and FreeBSD):

hook Windows macOS Linux/FreeBSD
obs_video_host_init_encode_surface(video, info, i) NV12/P010 encode staging surface (copy_surfaces_encode is a Windows-only field) true true
obs_video_host_free_encode_surface(video, i) destroy it no-op no-op
obs_host_start_graphics_thread(thread, param) plain obs_graphics_thread autoreleasing thread with QOS_CLASS_USER_INTERACTIVE plain
obs_host_startup() / obs_host_shutdown() COM init/uninit (state moved from obs.c) no-op no-op

Behavior-preserving. obs_init_textures keeps its break on the first failed surface; obs_startup's failure path with no core still undoes COM (else obs_host_shutdown()), alongside #1060's early return in obs_shutdown. obs.c has no platform conditionals left and leaves ci/platform-ifdef-baseline.json.

Local: ./lint rc 0, ratchet ok; full Tier 2 OFF: 256/258 passing, the two failures the real-time flakes of #838 (test_async_delay_audio, test_deinterlace_2x_field_order); the harness stops there, so ON runs in PR CI. ci-full is set: the Windows and macOS hook implementations are compiled only by the native builds.

…s-nix.c

obs.c's 8 platform conditionals become five hooks declared in
obs-internal.h, one implementation per host:
- obs_video_host_init_encode_surface / _free_encode_surface: the Windows
  NV12/P010 encode staging surfaces (copy_surfaces_encode is a
  Windows-only field); no-ops elsewhere. obs.c keeps the loop's break.
- obs_host_start_graphics_thread: macOS starts the autoreleasing thread
  with user-interactive QoS, the others the plain one.
- obs_host_startup / obs_host_shutdown: COM init/uninit and its state on
  Windows; obs_startup's no-core failure path still undoes it.

Behavior-preserving; obs.c leaves the #848 baseline.

Refs #868
@zackees zackees added the ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak label Oct 16, 2026
@zackees
zackees added this pull request to the merge queue Oct 16, 2026
@zackees
zackees removed this pull request from the merge queue due to a manual request Oct 16, 2026
@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Superseded by #1069 (merged 11:03Z), which moved obs.c's host code behind libobs/obs-host/ interfaces (obs_host_init_encode_copy_surface, obs_host_create_graphics_thread, obs_host_startup/shutdown) as part of #1051; this PR duplicated it and is now unmergeable. Closing; nothing here is needed on top of #1069. My miss: I checked for claims on #868 but not for in-flight PRs touching obs.c.

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

Labels

ci-full Run every CI job on this PR, including the release-gating OBS app builds and Flatpak

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

facade: libobs/obs.c: move 8 platform conditionals into obs-<os> files

1 participant