Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ yarn install
git submodule update --init --recursive
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=~/streamlabs/desktop/node_modules/obs-studio-node/OSN.app/distribute/obs-studio-node -DCMAKE_OSX_ARCHITECTURES=arm64 -G Xcode
cmake .. -DCMAKE_INSTALL_PREFIX=/Users/<you>/streamlabs/desktop/node_modules/obs-studio-node/OSN.app/distribute/obs-studio-node -DCMAKE_OSX_ARCHITECTURES=arm64 -G Xcode
cmake --build . --target install --config RelWithDebInfo
```
Note, the only gotcha is that if you later run `yarn package:mac` command in the desktop folder instead, then you should remove *OSN.app* from the `CMAKE_INSTALL_PREFIX` path. This is because the electron-builder scripts will throw an error this is not a fully formed app bundle during codesign.
Note, the only gotcha is that if you later run `yarn package:mac-arm64` command in the desktop folder instead, then you should remove *OSN.app* from the `CMAKE_INSTALL_PREFIX` path. This is because the electron-builder scripts will throw an error this is not a fully formed app bundle during codesign.

### Custom OBS Build
By default, we download a pre-built version of libobs if none is specified. However, this pre-built version may not be what you want to use or maybe you're testing a new obs feature.
Expand Down
10 changes: 8 additions & 2 deletions js/module.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NodeObs = exports.getSourcesSize = exports.createSources = exports.addItems = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.AdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.DisplayFactory = exports.TransitionFactory = exports.FilterFactory = exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0;
const obs = require('./obs_studio_client.node');
const path = require("path");
const fs = require("fs");
// Mac- search for optional OSN.app bundle (Chromium requires an app bundle to find obs64 helper apps)
const hasDeveloperApp = process.platform === 'darwin' && fs.existsSync(path.join(__dirname, 'OSN.app'));
const obs = hasDeveloperApp
? require('./OSN.app/distribute/obs-studio-node/obs_studio_client.node')
: require('./obs_studio_client.node');
exports.DefaultD3D11Path = path.resolve(__dirname, `libobs-d3d11.dll`);
exports.DefaultOpenGLPath = path.resolve(__dirname, `libobs-opengl.dll`);
exports.DefaultDrawPluginPath = path.resolve(__dirname, `simple_draw.dll`);
Expand Down Expand Up @@ -117,7 +121,9 @@ function getSourcesSize(sourcesNames) {
return sourcesSize;
}
exports.getSourcesSize = getSourcesSize;
const __dirnameApple = fs.existsSync(__dirname + '/OSN.app') ? __dirname + '/OSN.app/distribute/obs-studio-node/bin' : __dirname + '/bin'; // search for local developer OSN.app bundle which stores CEF helper apps
const __dirnameApple = hasDeveloperApp
? path.join(__dirname, 'OSN.app', 'distribute', 'obs-studio-node', 'bin')
: path.join(__dirname, 'bin');
if (fs.existsSync(path.resolve(__dirnameApple).replace('app.asar', 'app.asar.unpacked'))) {
obs.IPC.setServerPath(path.resolve(__dirnameApple, `obs64`).replace('app.asar', 'app.asar.unpacked'), path.resolve(__dirnameApple).replace('app.asar', 'app.asar.unpacked'));
}
Expand Down
10 changes: 8 additions & 2 deletions js/module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
const obs = require('./obs_studio_client.node');
import * as path from 'path';
import * as fs from 'fs';
// Mac- search for optional OSN.app bundle (Chromium requires an app bundle to find obs64 helper apps)
const hasDeveloperApp = process.platform === 'darwin' && fs.existsSync(path.join(__dirname, 'OSN.app'));
const obs = hasDeveloperApp
? require('./OSN.app/distribute/obs-studio-node/obs_studio_client.node')
: require('./obs_studio_client.node');

/* Convenient paths to modules */
export const DefaultD3D11Path: string =
Expand Down Expand Up @@ -1895,7 +1899,9 @@ export const enum VCamOutputType {
};

// Initialization and other stuff which needs local data.
const __dirnameApple = fs.existsSync(__dirname + '/OSN.app') ? __dirname + '/OSN.app/distribute/obs-studio-node/bin' : __dirname + '/bin'; // search for local developer OSN.app bundle which stores CEF helper apps
const __dirnameApple = hasDeveloperApp
? path.join(__dirname, 'OSN.app', 'distribute', 'obs-studio-node', 'bin')
: path.join(__dirname, 'bin');
if (fs.existsSync(path.resolve(__dirnameApple).replace('app.asar', 'app.asar.unpacked'))) {
obs.IPC.setServerPath(path.resolve(__dirnameApple, `obs64`).replace('app.asar', 'app.asar.unpacked'), path.resolve(__dirnameApple).replace('app.asar', 'app.asar.unpacked'));
}
Expand Down
2 changes: 1 addition & 1 deletion obs-studio-server/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ int main(int argc, char *argv[])

// Check versions
if (receivedVersion != myVersion) {
std::cerr << "Versions mismatch. Server version: " << myVersion << "but received client version: " << receivedVersion;
std::cerr << "Versions mismatch. Server version: " << myVersion << " but received client version: " << receivedVersion << std::endl;
return ipc::ProcessInfo::ExitCode::VERSION_MISMATCH;
}

Expand Down
Loading