macOS arm64 support (vanilla libobs 31.0.3)#26
Open
yuripiratello wants to merge 1 commit into
Open
Conversation
Adds macOS arm64 to noobs by porting the platform layer in obs_interface_mac.mm and building vanilla libobs + a small plugin set from obsproject/obs-studio source. No Streamlabs OSN. Build: - scripts/build-libobs-mac.sh clones obs-studio at the pinned tag, configures with the macos cmake preset (UI/browser/VLC/WebRTC/DeckLink/ scripting all OFF), builds obs-x264, obs-ffmpeg, mac-capture, mac-videotoolbox, image-source, obs-filters, and copies the framework + plugin bundles + libav* runtime dylibs + obs-ffmpeg-mux into the repo's Frameworks/, PlugIns/, and data/ trees. - dist.js handles the Mac side: cp -R for symlink preservation, install_name_tool -add_rpath @loader_path/../../.. on libobs and @loader_path/../../../../Frameworks on every .plugin binary so dyld resolves siblings without the OBS-bundle assumption. - .github/workflows/release-mac.yml: macos-14 runner, Xcode 15.2 + versioned MacOSX14.2.sdk pinned (OBS 31.0.3 compilerconfig regex doesn't match the unversioned symlink), runs the build script, packs the tarball, attaches to the GitHub Release on tag push. Workspace-internal vendor/obs-studio path so actions/cache hits. Runtime: - obs_interface_mac.mm hosts the canvas in a borderless transparent child NSWindow, addChildWindow:above attached to the parent BrowserWindow's NSWindow. setIgnoresMouseEvents:YES so events fall through to the renderer's editor overlay. Handle creation lazily on first configurePreview because the parent isn't on screen at initPreview time (Electron 'ready-to-show' fires later). - obs_display_resize takes BACKING pixels — multiply by backingScaleFactor so retina displays don't render the canvas at 1/4 size in the bottom-left corner. getPreviewInfo divides back out for renderer-side math. - listSceneItems wraps obs_scene_enum_items so consumers (e.g. WCR's scene editor) can hit-test items. Outlines + corner handles already drawn by setDrawSourceOutline. - Destructor cleanup: range-for + erase invalidates libc++ iterators on macOS arm64 and segfaults under PAC. Iterate, free, clear() once for sources/filters/volmeters/volmeter_cb_ctx. - disablePreview moved to mac.mm (#ifdef'd out in cpp) so it can do setHidden:YES on the child window when leaving the editor — without it the child lingers as a dark rect over whatever page replaces the editor. Versioning: - Pre-release tags vX.Y.Z-mac.beta.N attach a separate tarball per CI build for downstream beta testing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1e4edde to
d95a15c
Compare
Owner
|
How can this function without the recorder buffer? Many game modes rely on this to cope with log flush delays? This approach will frequently miss the start of BGs and any non-retail content where you can't rely on the log flushing on the start activity event? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds macOS arm64 support to noobs by porting the platform-specific code (
obs_interface_mac.mm) and building vanillalibobs31.0.3 + a small plugin set from the upstreamobsproject/obs-studiosource. No Streamlabs OSN.Companion PR on wow-recorder: aza547/wow-recorder#819
What this gives you
obs_interface_mac.mm— Mac equivalents of the WininitPreview/configurePreview/showPreview/hidePreview/disablePreview. Renders the canvas in a borderless, mouse-transparent childNSWindowattached viaaddChildWindow:ordered:NSWindowAbove. Same conceptual split asnode-window-renderingdoes on Win — separate window for the OBS canvas, BrowserWindow stays opaque, DOM events flow through to the renderer.obs_interface.cpp—listSceneItems()wrapsobs_scene_enum_itemsso consumers can hit-test scene items (used by the WCR scene editor on Mac).setDrawSourceOutlinealready paints orange outlines + corner handles for selected items.dist.js— Mac branch vendors the builtlibobs.framework+ plugin bundles +libobs-opengl.dylib+obs-ffmpeg-mux+ libav* dylibs intodist/Frameworksanddist/PlugIns. Patches@rpathon the libobs binary and on every.pluginso dyld resolves the sibling dylibs at runtime.scripts/build-libobs-mac.sh— clonesobsproject/obs-studioat the pinned tag, configures CMake with themacospreset (no UI / browser / VLC / WebRTC / DeckLink / scripting), builds the plugin set we need (obs-x264,obs-ffmpeg,mac-capture,mac-videotoolbox,image-source,obs-filters), and copies everything into the repo..github/workflows/release-mac.yml—macos-14runner job that runs the build script, packs the tarball asnoobs-darwin-arm64-<version>.tgz, attaches it to the GitHub Release on tag push. Pins Xcode 15.2 + versionedMacOSX14.2.sdkso OBS'scompilerconfig.cmakeregex matches.Replay buffer
Vanilla libobs has no
convertproc (Streamlabs OSN extension), so the Mac code path usesffmpeg_muxerdirectly. wow-recorder gates on a newsupportsReplayBuffercapability and starts recording at activity time on Mac — no pre-roll, but no buffer-cycling miscuts either. Win behaviour is untouched.Known limits
game_capturenot available on Mac (no DirectX/Vulkan hook equivalent).sources/filters/volmetersmap cleanup was changed from range-for-with-erase to iterate-then-clear because libc++ on macOS arm64 fault under PAC on the original pattern. Same pattern applied tovolmeter_cb_ctx.Versioning
The fork uses pre-release tags
vX.Y.Z-mac.beta.Nso each CI build attaches a separate tarball. Current beta:v0.0.182-mac.beta.5. Happy to align this with upstream's release naming if you'd prefer.Out of scope
test-errors/test-previeware Win-only and stay that way; Mac smoke-testing is via the consuming wow-recorder build.sck_audio_capturefor system out; finer per-bundle picker would be a follow-up).🤖 Generated with Claude Code