Skip to content

image-source: Host code behind image-source-host.h (#858) - #1252

Merged
zackees merged 2 commits into
masterfrom
facade/858-image-source-host
Oct 17, 2026
Merged

zackees merged 2 commits into
masterfrom
facade/858-image-source-host

Conversation

@zackees

@zackees zackees commented Oct 17, 2026

Copy link
Copy Markdown
Member

Closes #858 (parent #847). Same shape as #1248 (vlc-video).

Inventory moved (7 conditionals)

  • image-source.c.h (2): the Image source file dialog filter (*.jxr in "All formats" and the "JXR Files" entry on Windows only) -> image_source_host_image_filter().
  • obs-slideshow.c.h (2): .jxr in valid_extension() -> image_source_host_jxr_supported() && ...; slideshow filter -> image_source_host_slideshow_filter().
  • obs-slideshow-mk2.c.h (1): slideshow filter -> image_source_host_slideshow_filter().
  • image-file-version.c.h (2): the !_WIN32 stat-based image_file_version_get() and its st_mtimespec/st_mtim choice move to the macOS/POSIX hosts, through image_source_host_stat_mtime_nsec(). Windows keeps image-file-version-win32.c.h (name and role unchanged); image_file_version_equal()/_from_filetime() stay shared.

New: conditional-free image-source-host.h; image-source-host-{windows,macos,posix}.c.h. Windows host joins the existing image-source.windows group; new image-source.macos / image-source.posix groups + PCHs, picked by PLATFORM_ID in CMake. Filter strings are byte-identical per OS. No upstream file moved or renamed.

Existing tests are unchanged: test_image_file_version* and test_slideshow_* compile the shared files on their own, so tests.d/test_image_source_host.cmake attaches the host group to them via cmake_language(DEFER CALL ...).

Baseline delta

ci/platform-ifdef-baseline.json regenerated with --update: the 4 image-source entries drop (-7 findings).

RED / GREEN (rust/tools/linux-validate/run.sh --repeat 1)

  • RED (8e41171, stub host): test_image_source_host 4/4 FAILED (jxr, image filter, slideshow filter, mtime nsec); the rest of the suite passed.
  • GREEN (f12dcd1): 279/279 pass, including test_image_source_host, test_image_file_version, test_image_file_version_filetime, test_slideshow_empty, test_slideshow_manual_end, test_slideshow_size.

Windows / macOS

Not built locally; PR CI verifies them first. ci/ci_scope.py origin/master selects macos=true windows=true tier2=true linux_targets=image-source.

RED: test_image_source_host checks the POSIX host has no JPEG XR, the
Image source and slideshow file dialog filters byte for byte as they are
today off Windows, and the stat() sub-second modification time. The host
file is a stub.

Refs #858
GREEN: the 7 platform conditionals in image-source.c.h,
obs-slideshow.c.h, obs-slideshow-mk2.c.h and image-file-version.c.h move
behind image-source-host.h: whether JPEG XR is decoded, the Image source
and slideshow file dialog filters (byte for byte per OS), and the stat()
sub-second modification time with the stat-based
image_file_version_get(). image-source-host-{windows,macos,posix}.c.h are
in per-OS unity groups picked by CMake; the Windows one joins the existing
windows group. Upstream files keep their names.

The tests that compile the shared files alone get the host group attached
from test_image_source_host.cmake (cmake_language DEFER), so their own
files are unchanged. Baseline: image-source entries drop (-7).

Refs #858
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/image-source: move 7 platform conditionals behind a per-platform layer

1 participant