Skip to content

Fix: Build Compatibility Issues in XCode 26.4 with macOS plugins#13281

Open
andrewsoncha wants to merge 3 commits intoobsproject:masterfrom
andrewsoncha:master
Open

Fix: Build Compatibility Issues in XCode 26.4 with macOS plugins#13281
andrewsoncha wants to merge 3 commits intoobsproject:masterfrom
andrewsoncha:master

Conversation

@andrewsoncha
Copy link
Copy Markdown

@andrewsoncha andrewsoncha commented Apr 1, 2026

Description

Adds explicit type conversion within mac plugins:

  • mac-capture
  • mac-syphon
  • mac-videotoolbox
  • mac-virtualcam
    With the newest XCode 26.4 version, the compiler raises an error when there is an implicit type conversion between types with different sizes. Because of this, the code for the above plugins raise a compile error when compiled using the latest Apple Clang 21.0 and XCode 26.4.
    While there are many reasons for why doing type conversion between types with different sizes may be bad, the cases where they are used within the above plugins are well within range of the smaller type or are simple enum values.

Motivation and Context

The current obs-studio master branch fails to build with Apple Clang 21.0 and XCode 26.4 due to compile errors. The error has been reproduced by another member of the community (@WizardCM) The compile errors all come from implicit conversion of types within the source code of the the above mentioned plugins.

How Has This Been Tested?

Used Cmake to build the macos preset and used Xcode to compile. More specifically, followed the instructions here.
Used

cmake --preset macos

to generate a xcode project and used

xcodebuild -configuration Debug -scheme obs-studio -parallelizeTargets -destination "generic/platform=macOS,name=Any Mac"

to build the XCode Project and confirmed that there were no compile errors with the OBS source code.

While after applying the changes there are no more compile/build errors within the OBS source code, there is now a build error with the included qt library file, more specifically the obs-studio/.deps/obs-deps-qt6-2025-08-23-universal/lib/QtCore.framework/Headers/qyieldcpu.h file.
The error message is as follows:
image

While I was able to find this forum thread and apply changes listed there to the qyieldcpu.h and have it finally build without error, I was not able to include the changes to the included qt library in the pull request.

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

Replaced Implicit type conversion within mac plugins(mac-capture, mac-syphon, mac-videotoolbox, mac-virtualcam) with Explicit ones to clear compile errors with Apple Clang 21.0 and XCode 26.4.
@andrewsoncha andrewsoncha marked this pull request as draft April 1, 2026 21:13
@RytoEX RytoEX requested review from PatTheMav and gxalpha April 1, 2026 22:27
@andrewsoncha andrewsoncha marked this pull request as ready for review April 2, 2026 00:49
Copy link
Copy Markdown
Contributor

@jcm93 jcm93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, you should also remove the changes to obs-websocket in your commits, since those changes have already landed with 3a9cf4a.

Comment thread plugins/mac-virtualcam/src/dal-plugin/OBSDALStream.mm Outdated
Comment thread plugins/mac-capture/mac-audio.c Outdated
Comment thread plugins/mac-capture/mac-sck-common.m Outdated
Comment thread plugins/mac-syphon/syphon.m Outdated
Comment thread plugins/mac-videotoolbox/encoder.c Outdated
Comment thread plugins/mac-virtualcam/src/dal-plugin/CMSampleBufferUtils.mm Outdated
Comment thread plugins/mac-virtualcam/src/dal-plugin/OBSDALStream.mm Outdated
Comment thread plugins/mac-virtualcam/src/dal-plugin/OBSDALStream.mm Outdated
@andrewsoncha andrewsoncha reopened this Apr 2, 2026
@andrewsoncha andrewsoncha marked this pull request as draft April 2, 2026 17:54
@WizardCM WizardCM added Code Cleanup Non-breaking change which makes code smaller or more readable macOS Affects macOS labels Apr 3, 2026
Applied changes suggested by @jcm93 and @PatTheMav

Co-authored-by: PatTheMav <patthemav+github@gmail.com>
Co-authored-by: jcm <6864788+jcm93@users.noreply.github.com>
@andrewsoncha andrewsoncha marked this pull request as ready for review April 3, 2026 03:08
Comment thread plugins/mac-capture/mac-audio.c
Removed unnecessary code in plugins/mac-capture/mac-audio.c

Co-authored-by: jcm <6864788+jcm93@users.noreply.github.com>
Copy link
Copy Markdown
Member

@PatTheMav PatTheMav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm, the "The code has been tested" checkbox is set, so I assume all the changed paths have been confirmed to produce the same results as before?

@andrewsoncha
Copy link
Copy Markdown
Author

Yes. The code builds without any compile errors and the functionality related to macOS in the resulting program still functions the same as before.

@PatTheMav
Copy link
Copy Markdown
Member

Yes. The code builds without any compile errors and the functionality related to macOS in the resulting program still functions the same as before.

Sorry, I should've been more clear in my ask. Can you confirm that, e.g.:

  • The nanosecond timestamp provided by AudioConvertHostTimeToNanos indeed yields the same number as the old code?
  • The values passed to build_sprite_rect in syphon.m are identical?
  • The numbers passed as MaxKeyFrameInterval and ExpectedFrameRate in encoder.c have numerically the same value (so what was 30.0 should now be 30), did you test this with uncommon fractional frame rates (e.g. 30/7).

It'd not be the end of the world if outcomes change, but we'd need to know if things have potentially changed to figure out if those are desirable or undesirable changes.

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

Labels

Code Cleanup Non-breaking change which makes code smaller or more readable macOS Affects macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants