Compare commits

..

1 Commits

Author SHA1 Message Date
2f252f67ba CI: Fix tag detection 2021-02-10 16:26:38 -08:00
76 changed files with 1769 additions and 1669 deletions

BIN
.github/images/obsws_logo.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

412
.github/workflows/pr_push.yml vendored Normal file
View File

@ -0,0 +1,412 @@
name: 'CI Multiplatform Build'
on:
push:
paths-ignore:
- 'docs/**'
branches:
- 4.x-current
pull_request:
paths-ignore:
- '**.md'
branches:
- 4.x-current
jobs:
windows:
name: 'Windows 32+64bit'
runs-on: [windows-latest]
if: contains(github.event.head_commit.message, '[skip ci]') != true
env:
QT_VERSION: '5.10.1'
WINDOWS_DEPS_VERSION: '2017'
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_SYSTEM_VERSION: "10.0"
steps:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.0
- name: 'Checkout'
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/obs-websocket
submodules: 'recursive'
- name: 'Checkout OBS'
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: 'recursive'
- name: 'Get OBS-Studio git info'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git fetch --prune --unshallow
echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD)
echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_GIT_TAG }}
git submodule update
- name: 'Get obs-websocket git info'
shell: bash
working-directory: ${{ github.workspace }}/obs-websocket
run: |
git fetch --prune --unshallow
echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}
echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Install prerequisite: QT'
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C -
7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}\cmbuild\QT"
- name: 'Install prerequisite: Pre-built OBS dependencies'
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -f --retry 5 -C -
7z x dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -o"${{ github.workspace }}\cmbuild\deps"
- name: 'Restore OBS 32-bit build v${{ env.OBS_GIT_TAG }} from cache'
id: build-cache-obs-32
uses: actions/cache@v1
env:
CACHE_NAME: 'build-cache-obs-32'
with:
path: ${{ github.workspace }}/obs-studio/build32
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_NAME }}-
- name: 'Configure OBS 32-bit'
if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
mkdir .\build32
cd .\build32
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES ..
- name: 'Build OBS-Studio 32-bit'
if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
msbuild /m /p:Configuration=RelWithDebInfo .\build32\libobs\libobs.vcxproj
msbuild /m /p:Configuration=RelWithDebInfo .\build32\UI\obs-frontend-api\obs-frontend-api.vcxproj
- name: 'Restore OBS 64-bit build v${{ env.OBS_GIT_TAG }} from cache'
id: build-cache-obs-64
uses: actions/cache@v1
env:
CACHE_NAME: 'build-cache-obs-64'
with:
path: ${{ github.workspace }}/obs-studio/build64
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_NAME }}-
- name: 'Configure OBS 64-bit'
if: steps.build-cache-obs-64.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
mkdir .\build64
cd .\build64
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES ..
- name: 'Build OBS-Studio 64-bit'
if: steps.build-cache-obs-64.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
msbuild /m /p:Configuration=RelWithDebInfo .\build64\libobs\libobs.vcxproj
msbuild /m /p:Configuration=RelWithDebInfo .\build64\UI\obs-frontend-api\obs-frontend-api.vcxproj
- name: 'Configure obs-websocket 64-bit'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
mkdir .\build64
cd .\build64
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build64\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build64\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" ..
- name: 'Configure obs-websocket 32-bit'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
mkdir .\build32
cd .\build32
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build32\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build32\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build32\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" ..
- name: 'Build obs-websocket 64-bit'
working-directory: ${{ github.workspace }}/obs-websocket
run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-websocket.sln
- name: 'Build obs-websocket 32-bit'
working-directory: ${{ github.workspace }}/obs-websocket
run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-websocket.sln
- name: 'Set PR artifact filename'
shell: bash
run: |
FILENAME="obs-websocket-${{ env.GIT_HASH }}-Windows"
echo "::set-env name=FILENAME::$FILENAME"
- name: 'Package obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
mkdir package
cd package
7z a "${{ env.WIN_FILENAME }}.zip" "..\release\*"
iscc ..\installer\installer.iss /O. /F"${{ env.WIN_FILENAME }}-Installer"
- name: 'Publish ${{ env.WIN_FILENAME }}.zip'
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_HASH }}-Windows'
path: ${{ github.workspace }}/obs-websocket/package/*.zip
- name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe'
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_HASH }}-Windows-Installer'
path: ${{ github.workspace }}/obs-websocket/package/*.exe
ubuntu64:
name: "Linux/Ubuntu 64-bit"
runs-on: [ubuntu-latest]
if: contains(github.event.head_commit.message, '[skip ci]') != true
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/obs-websocket
submodules: 'recursive'
- name: 'Checkout OBS'
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: 'recursive'
- name: 'Get OBS-Studio git info'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git fetch --prune --unshallow
echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD)
echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_GIT_TAG }}
git submodule update
- name: 'Get obs-websocket git info'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
git fetch --prune --unshallow
echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}
echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Install prerequisites (Apt)'
shell: bash
run: |
sudo dpkg --add-architecture amd64
sudo apt-get -qq update
sudo apt-get install -y \
build-essential \
checkinstall \
cmake \
libasound2-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libcurl4-openssl-dev \
libfdk-aac-dev \
libfontconfig-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libjack-jackd2-dev \
libjansson-dev \
libluajit-5.1-dev \
libpulse-dev \
libqt5x11extras5-dev \
libspeexdsp-dev \
libswresample-dev \
libswscale-dev \
libudev-dev \
libv4l-dev \
libva-dev \
libvlc-dev \
libx11-dev \
libx264-dev \
libxcb-randr0-dev \
libxcb-shm0-dev \
libxcb-xinerama0-dev \
libxcomposite-dev \
libxinerama-dev \
libmbedtls-dev \
pkg-config \
python3-dev \
qtbase5-dev \
libqt5svg5-dev \
swig
- name: 'Configure OBS-Studio'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
mkdir ./build
cd ./build
cmake -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr ..
- name: 'Build OBS-Studio'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
set -e
cd ./build
make -j4 libobs obs-frontend-api
- name: 'Install OBS-Studio'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
cd ./build
sudo cp ./libobs/libobs.so /usr/lib
sudo cp ./UI/obs-frontend-api/libobs-frontend-api.so /usr/lib
sudo mkdir -p /usr/include/obs
sudo cp ../UI/obs-frontend-api/obs-frontend-api.h /usr/include/obs/obs-frontend-api.h
- name: 'Configure obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
mkdir ./build
cd ./build
cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr ..
- name: 'Build obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
set -e
cd ./build
make -j4
- name: 'Set PR artifact filename'
shell: bash
run: |
FILENAME="obs-websocket-1-${{ env.GIT_HASH }}-1_amd64.deb"
echo "::set-env name=FILENAME::$FILENAME"
- name: 'Package ${{ env.FILENAME }}'
if: success()
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
VERSION="1-${{ env.GIT_HASH }}-git"
cd ./build
sudo checkinstall -y --type=debian --fstrans=no -nodoc \
--backup=no --deldoc=yes --install=no --pkgname=obs-websocket --pkgversion=$VERSION \
--pkglicense="GPLv2.0" --maintainer="${{ github.event.pusher.email }}" --pkggroup="video" \
--pkgsource="${{ github.event.repository.html_url }}" \
--requires="obs-studio,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \
--pakdir="../package"
sudo chmod ao+r ../package/*
cd -
- name: 'Publish ${{ env.FILENAME }}'
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_HASH }}-linux'
path: '${{ github.workspace }}/obs-websocket/package/*.deb'
macos64:
name: "macOS 64-bit"
runs-on: [macos-latest]
if: contains(github.event.head_commit.message, '[skip ci]') != true
env:
MACOS_DEPS_VERSION: '2020-04-18'
QT_VERSION: '5.14.1'
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/obs-websocket
submodules: 'recursive'
- name: 'Checkout OBS'
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: 'recursive'
- name: 'Get OBS-Studio git info'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git fetch --prune --unshallow
echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD)
echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_GIT_TAG }}
git submodule update
- name: 'Get obs-websocket git info'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
git fetch --prune --unshallow
echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}
echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Install prerequisites (Homebrew)'
shell: bash
run: |
brew bundle --file ${{ github.workspace }}/obs-websocket/CI/macos/Brewfile
- name: 'Install prerequisite: Pre-built OBS dependencies'
shell: bash
run: |
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz
tar -xf ${{ github.workspace }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp"
- name: 'Configure OBS Studio'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
mkdir build
cd build
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake ..
- name: 'Build OBS Studio libraries'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
set -e
cd ./build
make -j4 libobs obs-frontend-api
- name: 'Configure obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
mkdir build
cd build
cmake -DQTDIR=/usr/local/Cellar/qt/${{ env.QT_VERSION }} -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DLIBOBS_LIB=${{ github.workspace }}/obs-studio/libobs -DOBS_FRONTEND_LIB="${{ github.workspace }}/obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr ..
- name: 'Build obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
set -e
cd ./build
make -j4
- name: 'Install prerequisite: Packages app'
if: success()
shell: bash
run: |
curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg
sudo installer -pkg ${{ github.workspace }}/Packages.pkg -target /
- name: 'Set PR artifact filename'
shell: bash
run: |
FILENAME_UNSIGNED="obs-websocket-${{ env.GIT_HASH }}-macOS-Unsigned.pkg"
echo "::set-env name=FILENAME_UNSIGNED::$FILENAME_UNSIGNED"
- name: 'Fix linked dynamic library paths'
if: success()
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ./build/obs-websocket.so
install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./build/obs-websocket.so
install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./build/obs-websocket.so
echo "Dependencies for obs-websocket"
otool -L ./build/obs-websocket.so
- name: 'Package ${{ env.FILENAME }}'
if: success()
working-directory: ./obs-websocket
shell: bash
run: |
packagesbuild ./CI/macos/obs-websocket.pkgproj
mv ./release/obs-websocket.pkg ./release/${{ env.FILENAME_UNSIGNED }}
- name: 'Publish ${{ env.FILENAME_UNSIGNED }} artifact'
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_HASH }}-macOS'
path: ${{ github.workspace }}/obs-websocket/release/*.pkg

484
.github/workflows/tag_release.yml vendored Normal file
View File

@ -0,0 +1,484 @@
name: 'CI Multiplatform Release'
on:
push:
paths-ignore:
- 'docs/**'
tags:
- '[45].[0-9]+.[0-9]+'
jobs:
windows:
name: 'Windows 32+64bit'
runs-on: [windows-latest]
env:
QT_VERSION: '5.10.1'
WINDOWS_DEPS_VERSION: '2017'
CMAKE_GENERATOR: "Visual Studio 16 2019"
CMAKE_SYSTEM_VERSION: "10.0"
steps:
- name: 'Add msbuild to PATH'
uses: microsoft/setup-msbuild@v1.0.0
- name: 'Checkout'
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/obs-websocket
submodules: 'recursive'
- name: 'Checkout OBS'
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: 'recursive'
- name: 'Get OBS-Studio git info'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git fetch --prune --unshallow
echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD)
echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_GIT_TAG }}
git submodule update
- name: 'Get obs-websocket git info'
shell: bash
working-directory: ${{ github.workspace }}/obs-websocket
run: |
git fetch --prune --unshallow
echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}
echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Install prerequisite: QT'
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_${{ env.QT_VERSION }}.7z -f --retry 5 -C -
7z x Qt_${{ env.QT_VERSION }}.7z -o"${{ github.workspace }}\cmbuild\QT"
- name: 'Install prerequisite: Pre-built OBS dependencies'
run: |
curl -kLO https://cdn-fastly.obsproject.com/downloads/dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -f --retry 5 -C -
7z x dependencies${{ env.WINDOWS_DEPS_VERSION }}.zip -o"${{ github.workspace }}\cmbuild\deps"
- name: 'Restore OBS 32-bit build v${{ env.OBS_GIT_TAG }} from cache'
id: build-cache-obs-32
uses: actions/cache@v1
env:
CACHE_NAME: 'build-cache-obs-32'
with:
path: ${{ github.workspace }}/obs-studio/build32
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_NAME }}-
- name: 'Configure OBS 32-bit'
if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
mkdir .\build32
cd .\build32
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES ..
- name: 'Build OBS-Studio 32-bit'
if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
msbuild /m /p:Configuration=RelWithDebInfo .\build32\libobs\libobs.vcxproj
msbuild /m /p:Configuration=RelWithDebInfo .\build32\UI\obs-frontend-api\obs-frontend-api.vcxproj
- name: 'Restore OBS 64-bit build v${{ env.OBS_GIT_TAG }} from cache'
id: build-cache-obs-64
uses: actions/cache@v1
env:
CACHE_NAME: 'build-cache-obs-64'
with:
path: ${{ github.workspace }}/obs-studio/build64
key: ${{ runner.os }}-${{ env.CACHE_NAME }}-${{ env.OBS_GIT_TAG }}
restore-keys: |
${{ runner.os }}-${{ env.CACHE_NAME }}-
- name: 'Configure OBS 64-bit'
if: steps.build-cache-obs-64.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
mkdir .\build64
cd .\build64
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES ..
- name: 'Build OBS-Studio 64-bit'
if: steps.build-cache-obs-64.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
run: |
msbuild /m /p:Configuration=RelWithDebInfo .\build64\libobs\libobs.vcxproj
msbuild /m /p:Configuration=RelWithDebInfo .\build64\UI\obs-frontend-api\obs-frontend-api.vcxproj
- name: 'Configure obs-websocket 64-bit'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
mkdir .\build64
cd .\build64
cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017_64" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build64\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build64\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build64\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" ..
- name: 'Configure obs-websocket 32-bit'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
mkdir .\build32
cd .\build32
cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2017" -DLibObs_DIR="${{ github.workspace }}\obs-studio\build32\libobs" -DLIBOBS_INCLUDE_DIR="${{ github.workspace }}\obs-studio\libobs" -DLIBOBS_LIB="${{ github.workspace }}\obs-studio\build32\libobs\RelWithDebInfo\obs.lib" -DOBS_FRONTEND_LIB="${{ github.workspace }}\obs-studio\build32\UI\obs-frontend-api\RelWithDebInfo\obs-frontend-api.lib" ..
- name: 'Build obs-websocket 64-bit'
working-directory: ${{ github.workspace }}/obs-websocket
run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-websocket.sln
- name: 'Build obs-websocket 32-bit'
working-directory: ${{ github.workspace }}/obs-websocket
run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-websocket.sln
- name: 'Set release filename'
shell: bash
run: |
FILENAME="obs-websocket-${{ env.GIT_TAG }}-Windows"
echo "::set-env name=WIN_FILENAME::$FILENAME"
- name: 'Package obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
mkdir package
cd package
7z a "${{ env.WIN_FILENAME }}.zip" "..\release\*"
iscc ..\installer\installer.iss /O. /F"${{ env.WIN_FILENAME }}-Installer"
- name: 'Publish ${{ env.WIN_FILENAME }}.zip'
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_TAG }}-Windows'
path: ${{ github.workspace }}/obs-websocket/package/*.zip
- name: 'Publish ${{ env.WIN_FILENAME }}-Installer.exe'
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_TAG }}-Windows-Installer'
path: ${{ github.workspace }}/obs-websocket/package/*.exe
ubuntu64:
name: "Linux/Ubuntu 64-bit"
runs-on: [ubuntu-latest]
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/obs-websocket
submodules: 'recursive'
- name: 'Checkout OBS'
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: 'recursive'
- name: 'Get OBS-Studio git info'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git fetch --prune --unshallow
echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD)
echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_GIT_TAG }}
git submodule update
- name: 'Get obs-websocket git info'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
git fetch --prune --unshallow
echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}
echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Install prerequisites (Apt)'
shell: bash
run: |
sudo dpkg --add-architecture amd64
sudo apt-get -qq update
sudo apt-get install -y \
build-essential \
checkinstall \
cmake \
libasound2-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libcurl4-openssl-dev \
libfdk-aac-dev \
libfontconfig-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libjack-jackd2-dev \
libjansson-dev \
libluajit-5.1-dev \
libpulse-dev \
libqt5x11extras5-dev \
libspeexdsp-dev \
libswresample-dev \
libswscale-dev \
libudev-dev \
libv4l-dev \
libva-dev \
libvlc-dev \
libx11-dev \
libx264-dev \
libxcb-randr0-dev \
libxcb-shm0-dev \
libxcb-xinerama0-dev \
libxcomposite-dev \
libxinerama-dev \
libmbedtls-dev \
pkg-config \
python3-dev \
qtbase5-dev \
libqt5svg5-dev \
swig
- name: 'Configure OBS-Studio'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
mkdir ./build
cd ./build
cmake -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES -DCMAKE_INSTALL_PREFIX=/usr ..
- name: 'Build OBS-Studio'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
set -e
cd ./build
make -j4 libobs obs-frontend-api
- name: 'Install OBS-Studio'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
cd ./build
sudo cp ./libobs/libobs.so /usr/lib
sudo cp ./UI/obs-frontend-api/libobs-frontend-api.so /usr/lib
sudo mkdir -p /usr/include/obs
sudo cp ../UI/obs-frontend-api/obs-frontend-api.h /usr/include/obs/obs-frontend-api.h
- name: 'Configure obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
mkdir ./build
cd ./build
cmake -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr ..
- name: 'Build obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
set -e
cd ./build
make -j4
- name: 'Set release filename'
shell: bash
run: |
FILENAME="obs-websocket-${{ env.GIT_TAG }}-1_amd64.deb"
echo "::set-env name=LINUX_FILENAME::$FILENAME"
- name: 'Package ${{ env.LINUX_FILENAME }}'
if: success()
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
VERSION="${{ env.GIT_TAG }}"
cd ./build
sudo checkinstall -y --type=debian --fstrans=no -nodoc \
--backup=no --deldoc=yes --install=no --pkgname=obs-websocket --pkgversion=$VERSION \
--pkglicense="GPLv2.0" --maintainer="${{ github.event.pusher.email }}" --pkggroup="video" \
--pkgsource="${{ github.event.repository.html_url }}" \
--requires="obs-studio,libqt5core5a,libqt5widgets5,qt5-image-formats-plugins" \
--pakdir="../package"
sudo chmod ao+r ../package/*
cd -
- name: 'Publish ${{ env.LINUX_FILENAME }}'
if: success()
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_TAG }}-linux'
path: '${{ github.workspace }}/obs-websocket/package/*.deb'
macos64:
name: "macOS 64-bit"
runs-on: [macos-latest]
env:
MACOS_DEPS_VERSION: '2020-04-18'
QT_VERSION: '5.14.1'
steps:
- name: 'Checkout'
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/obs-websocket
submodules: 'recursive'
- name: 'Checkout OBS'
uses: actions/checkout@v2
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: 'recursive'
- name: 'Get OBS-Studio git info'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git fetch --prune --unshallow
echo ::set-env name=OBS_GIT_BRANCH::$(git rev-parse --abbrev-ref HEAD)
echo ::set-env name=OBS_GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=OBS_GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Checkout last OBS-Studio release (${{ env.OBS_GIT_TAG }})'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_GIT_TAG }}
git submodule update
- name: 'Get obs-websocket git info'
working-directory: ${{ github.workspace }}/obs-websocket
run: |
git fetch --prune --unshallow
echo ::set-env name=GIT_BRANCH::${{ github.event.pull_request.head.ref }}
echo ::set-env name=GIT_HASH::$(git rev-parse --short HEAD)
echo ::set-env name=GIT_TAG::$(git describe --tags --abbrev=0)
- name: 'Install prerequisites (Homebrew)'
shell: bash
run: |
brew bundle --file ${{ github.workspace }}/obs-websocket/CI/macos/Brewfile
- name: 'Install prerequisite: Pre-built OBS dependencies'
shell: bash
run: |
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${{ env.MACOS_DEPS_VERSION }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz
tar -xf ${{ github.workspace }}/osx-deps-${{ env.MACOS_DEPS_VERSION }}.tar.gz -C "/tmp"
- name: 'Configure OBS Studio'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
mkdir build
cd build
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DENABLE_SCRIPTING=NO -DDepsPath=/tmp/obsdeps -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt/${{ env.QT_VERSION }}/lib/cmake ..
- name: 'Build OBS Studio libraries'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
set -e
cd ./build
make -j4 libobs obs-frontend-api
- name: 'Configure obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
mkdir build
cd build
cmake -DQTDIR=/usr/local/Cellar/qt/${{ env.QT_VERSION }} -DLIBOBS_INCLUDE_DIR=${{ github.workspace }}/obs-studio/libobs -DLIBOBS_LIB=${{ github.workspace }}/obs-studio/libobs -DOBS_FRONTEND_LIB="${{ github.workspace }}/obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr ..
- name: 'Build obs-websocket'
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
set -e
cd ./build
make -j4
- name: 'Install prerequisite: Packages app'
if: success()
shell: bash
run: |
curl -L -O https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg
sudo installer -pkg ${{ github.workspace }}/Packages.pkg -target /
- name: 'Set release filename'
if: success() && startsWith(github.ref, 'refs/tags')
shell: bash
run: |
FILENAME_UNSIGNED="obs-websocket-${{ env.GIT_TAG }}-macOS-Unsigned.pkg"
FILENAME="obs-websocket-${{ env.GIT_TAG }}-macOS.pkg"
echo "::set-env name=MAC_FILENAME_UNSIGNED::$FILENAME_UNSIGNED"
echo "::set-env name=MAC_FILENAME::$FILENAME"
- name: 'Fix linked dynamic library paths'
if: success()
working-directory: ${{ github.workspace }}/obs-websocket
shell: bash
run: |
install_name_tool -change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets @executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets ./build/obs-websocket.so
install_name_tool -change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui @executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui ./build/obs-websocket.so
install_name_tool -change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore ./build/obs-websocket.so
echo "Dependencies for obs-websocket"
otool -L ./build/obs-websocket.so
- name: 'Install Apple Developer Certificate'
if: success()
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
with:
p12-file-base64: ${{ secrets.MACOS_CERT_CODESIGN }}
p12-password: ${{ secrets.MACOS_CERT_PASS }}
- name: 'Code signing'
if: success()
working-directory: ./obs-websocket
shell: bash
run: |
set -e
codesign --sign "${{ secrets.MACOS_IDENT_CODESIGN }}" ./build/obs-websocket.so
packagesbuild ./CI/macos/obs-websocket.pkgproj
mv ./release/obs-websocket.pkg ./release/${{ env.MAC_FILENAME_UNSIGNED }}
productsign --sign "${{ secrets.MACOS_IDENT_INSTALLER }}" ./release/${{ env.MAC_FILENAME_UNSIGNED }} ./release/${{ env.MAC_FILENAME }}
rm ./release/${{ env.MAC_FILENAME_UNSIGNED }}
- name: 'Notarization'
if: success()
working-directory: ./obs-websocket
shell: bash
run: |
set -e
xcrun altool --store-password-in-keychain-item "AC_PASSWORD" -u "${{ secrets.MACOS_IDENT_USER }}" -p "${{ secrets.MACOS_IDENT_PASS }}"
xcnotary precheck ./release/${{ env.MAC_FILENAME }}
if [ "$?" -eq 0 ]; then xcnotary notarize ./release/${{ env.MAC_FILENAME }} --developer-account "${{ secrets.MACOS_IDENT_USER }}" --developer-password-keychain-item "AC_PASSWORD" --provider "${{ secrets.MACOS_IDENT_PROVIDER }}"; fi
- name: 'Publish ${{ env.MAC_FILENAME }} artifact'
if: success() && startsWith(github.ref, 'refs/tags')
uses: actions/upload-artifact@v2-preview
with:
name: '${{ env.GIT_TAG }}-macOS'
path: ${{ github.workspace }}/obs-websocket/release/*.pkg
make-release:
name: 'Create and upload release'
runs-on: [ubuntu-latest]
needs: [windows, ubuntu64, macos64]
steps:
- name: 'Get the version'
shell: bash
id: get_version
run: |
echo ::set-env name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
- name: 'Create Release'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_VERSION }}
release_name: obs-websocket ${{ env.TAG_VERSION }}
draft: false
prerelease: false
- name: 'Download release artifacts'
uses: actions/download-artifact@v2-preview
- name: 'Upload Windows .zip artifact to release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-Windows/obs-websocket-${{ env.TAG_VERSION }}-Windows.zip
asset_name: obs-websocket-${{ env.TAG_VERSION }}-Windows.zip
asset_content_type: application/zip
- name: 'Upload Windows .exe artifact to release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-Windows-Installer/obs-websocket-${{ env.TAG_VERSION }}-Windows-Installer.exe
asset_name: obs-websocket-${{ env.TAG_VERSION }}-Windows-Installer.exe
asset_content_type: application/zip
- name: 'Upload Linux artifact to release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-linux/obs-websocket_${{ env.TAG_VERSION }}-1_amd64.deb
asset_name: obs-websocket-${{ env.TAG_VERSION }}-1_amd64.deb
asset_content_type: application/octet-stream
- name: 'Upload macOS artifact to release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ github.workspace }}/${{ env.TAG_VERSION }}-macOS/obs-websocket-${{ env.TAG_VERSION }}-macOS.pkg
asset_name: obs-websocket-${{ env.TAG_VERSION }}-macOS.pkg
asset_content_type: application/octet-stream

View File

@ -2,7 +2,7 @@
## Prerequisites
You'll need [Qt 5.15.2](https://download.qt.io/official_releases/qt/5.15/5.15.2/),
You'll need [Qt 5.10.x](https://download.qt.io/official_releases/qt/5.10/),
[CMake](https://cmake.org/download/) and a working [OBS Studio development environment](https://obsproject.com/wiki/install-instructions) installed on your
computer.
@ -53,10 +53,10 @@ look for issues or specificities.
```shell
git clone --recursive https://github.com/Palakis/obs-websocket.git
cd obs-websocket
./CI/macos/install-dependencies-macos.sh
./CI/macos/install-build-obs-macos.sh
./CI/macos/build-plugin-macos.sh
./CI/macos/package-plugin-macos.sh
./CI/install-dependencies-macos.sh
./CI/install-build-obs-macos.sh
./CI/build-macos.sh
./CI/package-macos.sh
```
This will result in a ready-to-use `obs-websocket.pkg` installer in the `release` subfolder.

View File

@ -3,25 +3,26 @@
OSTYPE=$(uname)
if [ "${OSTYPE}" != "Darwin" ]; then
echo "[obs-websocket - Error] macOS build script can be run on Darwin-type OS only."
exit 1
echo "[obs-websocket - Error] macOS build script can be run on Darwin-type OS only."
exit 1
fi
HAS_CMAKE=$(type cmake 2>/dev/null)
if [ "${HAS_CMAKE}" = "" ]; then
echo "[obs-websocket - Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
exit 1
echo "[obs-websocket - Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
exit 1
fi
#export QT_PREFIX="$(find /usr/local/Cellar/qt5 -d 1 | tail -n 1)"
echo "[obs-websocket] Building 'obs-websocket' for macOS."
mkdir -p build && cd build
cmake .. \
-DQTDIR=/tmp/obsdeps \
-DQTDIR=/usr/local/opt/qt \
-DLIBOBS_INCLUDE_DIR=../../obs-studio/libobs \
-DLIBOBS_LIB=../../obs-studio/libobs \
-DOBS_FRONTEND_LIB="$(pwd)/../../obs-studio/build/UI/obs-frontend-api/libobs-frontend-api.dylib" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
&& make -j4

View File

@ -1,9 +1,6 @@
#!/bin/sh
set -ex
echo "[obs-websocket] Running CMake.."
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr -DUSE_UBUNTU_FIX=true ..
echo "[obs-websocket] Building plugin.."
make -j4

6
CI/download-obs-deps.cmd Normal file
View File

@ -0,0 +1,6 @@
if not exist %DepsBasePath% (
curl -o %DepsBasePath%.zip -kLO https://obsproject.com/downloads/dependencies2017.zip -f --retry 5 -C -
7z x %DepsBasePath%.zip -o%DepsBasePath%
) else (
echo "OBS dependencies are already there. Download skipped."
)

42
CI/install-build-obs-macos.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/sh
OSTYPE=$(uname)
if [ "${OSTYPE}" != "Darwin" ]; then
echo "[obs-websocket - Error] macOS obs-studio build script can be run on Darwin-type OS only."
exit 1
fi
HAS_CMAKE=$(type cmake 2>/dev/null)
HAS_GIT=$(type git 2>/dev/null)
if [ "${HAS_CMAKE}" = "" ]; then
echo "[obs-websocket - Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
exit 1
fi
if [ "${HAS_GIT}" = "" ]; then
echo "[obs-websocket - Error] Git not installed - please install Xcode developer tools or via Homebrew."
exit 1
fi
echo "[obs-websocket] Downloading and unpacking OBS dependencies"
wget --quiet --retry-connrefused --waitretry=1 https://obs-nightly.s3.amazonaws.com/osx-deps-2018-08-09.tar.gz
tar -xf ./osx-deps-2018-08-09.tar.gz -C /tmp
# Build obs-studio
cd ..
echo "[obs-websocket] Cloning obs-studio from GitHub.."
git clone https://github.com/obsproject/obs-studio
cd obs-studio
OBSLatestTag=$(git describe --tags --abbrev=0)
git checkout $OBSLatestTag
mkdir build && cd build
echo "[obs-websocket] Building obs-studio.."
cmake .. \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \
-DDISABLE_PLUGINS=true \
-DENABLE_SCRIPTING=0 \
-DDepsPath=/tmp/obsdeps \
-DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \
&& make -j4

View File

@ -0,0 +1,56 @@
#!/bin/sh
OSTYPE=$(uname)
if [ "${OSTYPE}" != "Darwin" ]; then
echo "[obs-websocket - Error] macOS install dependencies script can be run on Darwin-type OS only."
exit 1
fi
HAS_BREW=$(type brew 2>/dev/null)
if [ "${HAS_BREW}" = "" ]; then
echo "[obs-websocket - Error] Please install Homebrew (https://www.brew.sh/) to build obs-websocket on macOS."
exit 1
fi
# OBS Studio deps
echo "[obs-websocket] Updating Homebrew.."
brew update >/dev/null
echo "[obs-websocket] Checking installed Homebrew formulas.."
BREW_PACKAGES=$(brew list)
BREW_DEPENDENCIES="jack speexdsp ccache swig mbedtls"
for DEPENDENCY in ${BREW_DEPENDENCIES}; do
if echo "${BREW_PACKAGES}" | grep -q "^${DEPENDENCY}\$"; then
echo "[obs-websocket] Upgrading OBS-Studio dependency '${DEPENDENCY}'.."
brew upgrade ${DEPENDENCY} 2>/dev/null
else
echo "[obs-websocket] Installing OBS-Studio dependency '${DEPENDENCY}'.."
brew install ${DEPENDENCY} 2>/dev/null
fi
done
# qtwebsockets deps
echo "[obs-websocket] Installing obs-websocket dependency 'QT 5.10.1'.."
brew install ./CI/macos/qt.rb
# Pin this version of QT5 to avoid `brew upgrade`
# upgrading it to incompatible version
brew pin qt
# Fetch and install Packages app
# =!= NOTICE =!=
# Installs a LaunchDaemon under /Library/LaunchDaemons/fr.whitebox.packages.build.dispatcher.plist
# =!= NOTICE =!=
HAS_PACKAGES=$(type packagesbuild 2>/dev/null)
if [ "${HAS_PACKAGES}" = "" ]; then
echo "[obs-websocket] Installing Packaging app (might require password due to 'sudo').."
curl -o './Packages.pkg' --retry-connrefused -s --retry-delay 1 'https://s3-us-west-2.amazonaws.com/obs-nightly/Packages.pkg'
sudo installer -pkg ./Packages.pkg -target /
fi

View File

@ -0,0 +1,19 @@
#!/bin/sh
set -ex
sudo add-apt-repository -y ppa:obsproject/obs-studio
sudo apt-get -qq update
sudo apt-get install -y \
libc-dev-bin \
libc6-dev git \
build-essential \
checkinstall \
cmake \
obs-studio \
qtbase5-dev
# Dirty hack
sudo wget -O /usr/include/obs/obs-frontend-api.h https://raw.githubusercontent.com/obsproject/obs-studio/26.0.0/UI/obs-frontend-api/obs-frontend-api.h
sudo ldconfig

8
CI/install-qt-win.cmd Normal file
View File

@ -0,0 +1,8 @@
if not exist %QtBaseDir% (
curl -kLO https://cdn-fastly.obsproject.com/downloads/Qt_5.10.1.7z -f --retry 5 -z Qt_5.10.1.7z
7z x Qt_5.10.1.7z -o%QtBaseDir%
) else (
echo "Qt is already installed. Download skipped."
)
dir %QtBaseDir%

View File

@ -1,29 +0,0 @@
#!/bin/sh
set -ex
echo "[obs-websocket] Installing obs-studio PPA and updates.."
sudo add-apt-repository -y ppa:obsproject/obs-studio
sudo apt-get -qq update
echo "[obs-websocket] Installing obs-studio and dependencies.."
sudo apt-get install -y \
libc-dev-bin \
libc6-dev git \
build-essential \
checkinstall \
cmake \
obs-studio \
qtbase5-dev
wget https://launchpad.net/~gol-d-ace/+archive/ubuntu/obs-studio/+build/22244364/+files/obs-studio_27.1.3-0obsproject1~focal_amd64.deb
sudo dpkg -i ./*.deb
echo "[obs-websocket] Installed OBS Version: $(obs --version)"
ls /usr/include/
ls /usr/include/obs/
# Dirty hack
sudo wget -O /usr/include/obs/obs-frontend-api.h https://raw.githubusercontent.com/obsproject/obs-studio/27.1.3/UI/obs-frontend-api/obs-frontend-api.h
sudo ldconfig

View File

@ -1,5 +1,10 @@
tap "akeru-inc/tap"
brew "jack"
brew "speexdsp"
brew "cmake"
brew "freetype"
brew "fdk-aac"
brew "https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb"
brew "swig", link: false
brew "https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb"
brew "akeru-inc/tap/xcnotary"

View File

@ -1,39 +0,0 @@
#!/bin/sh
OSTYPE=$(uname)
if [ "${OSTYPE}" != "Darwin" ]; then
echo "[obs-websocket - Error] macOS obs-studio build script can be run on Darwin-type OS only."
exit 1
fi
HAS_CMAKE=$(type cmake 2>/dev/null)
HAS_GIT=$(type git 2>/dev/null)
if [ "${HAS_CMAKE}" = "" ]; then
echo "[obs-websocket - Error] CMake not installed - please run 'install-dependencies-macos.sh' first."
exit 1
fi
if [ "${HAS_GIT}" = "" ]; then
echo "[obs-websocket - Error] Git not installed - please install Xcode developer tools or via Homebrew."
exit 1
fi
# Build obs-studio
cd ..
echo "[obs-websocket] Cloning obs-studio from GitHub.."
git clone https://github.com/obsproject/obs-studio
cd obs-studio
OBSLatestTag=$(git describe --tags --abbrev=0)
git checkout 27.1.3
mkdir build && cd build
echo "[obs-websocket] Building obs-studio.."
cmake .. \
-DQTDIR=/tmp/obsdeps \
-DDepsPath=/tmp/obsdeps \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.13 \
-DDISABLE_PLUGINS=true \
-DENABLE_SCRIPTING=0 \
-DCMAKE_PREFIX_PATH=/tmp/obsdeps/lib/cmake \
&& make -j4

View File

@ -1,57 +0,0 @@
#!/bin/sh
OSTYPE=$(uname)
if [ "${OSTYPE}" != "Darwin" ]; then
echo "[obs-websocket - Error] macOS install dependencies script can be run on Darwin-type OS only."
exit 1
fi
HAS_BREW=$(type brew 2>/dev/null)
if [ "${HAS_BREW}" = "" ]; then
echo "[obs-websocket - Error] Please install Homebrew (https://www.brew.sh/) to build obs-websocket on macOS."
exit 1
fi
# OBS Studio Brew Deps
echo "[obs-websocket] Updating Homebrew.."
brew update >/dev/null
echo "[obs-websocket] Checking installed Homebrew formulas.."
if [ -d /usr/local/opt/openssl@1.0.2t ]; then
brew uninstall openssl@1.0.2t
brew untap local/openssl
fi
if [ -d /usr/local/opt/python@2.7.17 ]; then
brew uninstall python@2.7.17
brew untap local/python2
fi
brew bundle --file ./CI/macos/Brewfile
# Fetch and install Packages app
# =!= NOTICE =!=
# Installs a LaunchDaemon under /Library/LaunchDaemons/fr.whitebox.packages.build.dispatcher.plist
# =!= NOTICE =!=
HAS_PACKAGES=$(type packagesbuild 2>/dev/null)
if [ "${HAS_PACKAGES}" = "" ]; then
echo "[obs-websocket] Installing Packaging app (might require password due to 'sudo').."
curl -L -O http://s.sudre.free.fr/Software/files/Packages.dmg
sudo hdiutil attach ./Packages.dmg
sudo installer -pkg /Volumes/Packages\ 1.2.10/Install\ Packages.pkg -target /
fi
# OBS Deps
echo "[obs-websocket] Installing obs-websocket dependency 'OBS Deps ${OBS_DEPS_VERSION}'.."
wget --quiet --retry-connrefused --waitretry=1 https://github.com/obsproject/obs-deps/releases/download/${OBS_DEPS_VERSION}/macos-deps-${OBS_DEPS_VERSION}.tar.gz
tar -xf ./macos-deps-${OBS_DEPS_VERSION}.tar.gz -C /tmp
# Qt deps
echo "[obs-websocket] Installing obs-websocket dependency 'Qt ${QT_VERSION}'.."
curl -L -O https://github.com/obsproject/obs-deps/releases/download/${OBS_DEPS_VERSION}/macos-qt-${QT_VERSION}-${OBS_DEPS_VERSION}.tar.gz
tar -xf ./macos-qt-${QT_VERSION}-${OBS_DEPS_VERSION}.tar.gz -C "/tmp"
xattr -r -d com.apple.quarantine /tmp/obsdeps

View File

@ -36,7 +36,7 @@
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>../../build/obs-websocket-compat.so</string>
<string>../../build/obs-websocket.so</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
@ -80,7 +80,7 @@
<key>GID</key>
<integer>80</integer>
<key>PATH</key>
<string>obs-websocket-compat</string>
<string>obs-websocket</string>
<key>PATH_TYPE</key>
<integer>0</integer>
<key>PERMISSIONS</key>
@ -514,11 +514,11 @@
<key>CONCLUSION_ACTION</key>
<integer>0</integer>
<key>IDENTIFIER</key>
<string>fr.palakis.obs-websocket-compat</string>
<string>fr.palakis.obs-websocket</string>
<key>OVERWRITE_PERMISSIONS</key>
<false/>
<key>VERSION</key>
<string>4.9.1-compat</string>
<string>4.9.0</string>
</dict>
<key>PROJECT_COMMENTS</key>
<dict>
@ -715,7 +715,7 @@
</dict>
</array>
<key>NAME</key>
<string>obs-websocket-compat</string>
<string>obs-websocket</string>
</dict>
</dict>
<key>TYPE</key>

145
CI/macos/qt.rb Normal file
View File

@ -0,0 +1,145 @@
# Patches for Qt must be at the very least submitted to Qt's Gerrit codereview
# rather than their bug-report Jira. The latter is rarely reviewed by Qt.
class Qt < Formula
desc "Cross-platform application and UI framework"
homepage "https://www.qt.io/"
url "https://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
mirror "https://www.mirrorservice.org/sites/download.qt-project.org/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
sha256 "05ffba7b811b854ed558abf2be2ddbd3bb6ddd0b60ea4b5da75d277ac15e740a"
head "https://code.qt.io/qt/qt5.git", :branch => "5.10", :shallow => false
bottle do
sha256 "8b4bad005596a5f8790150fe455db998ac2406f4e0f04140d6656205d844d266" => :high_sierra
sha256 "9c488554935fb573554a4e36d36d3c81e47245b7fefc4b61edef894e67ba1740" => :sierra
sha256 "c0407afba5951df6cc4c6f6c1c315972bd41c99cecb4e029919c4c15ab6f7bdc" => :el_capitan
end
keg_only "Qt 5 has CMake issues when linked"
option "with-docs", "Build documentation"
option "with-examples", "Build examples"
option "without-proprietary-codecs", "Don't build with proprietary codecs (e.g. mp3)"
# OS X 10.7 Lion is still supported in Qt 5.5, but is no longer a reference
# configuration and thus untested in practice. Builds on OS X 10.7 have been
# reported to fail: <https://github.com/Homebrew/homebrew/issues/45284>.
# depends_on :macos => :mountain_lion
depends_on "pkg-config" => :build
depends_on :xcode => :build
depends_on "mysql" => :optional
depends_on "postgresql" => :optional
# Restore `.pc` files for framework-based build of Qt 5 on OS X. This
# partially reverts <https://codereview.qt-project.org/#/c/140954/> merged
# between the 5.5.1 and 5.6.0 releases. (Remove this as soon as feasible!)
#
# Core formulae known to fail without this patch (as of 2016-10-15):
# * gnuplot (with `--with-qt` option)
# * mkvtoolnix (with `--with-qt` option, silent build failure)
# * poppler (with `--with-qt` option)
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/e8fe6567/qt5/restore-pc-files.patch"
sha256 "48ff18be2f4050de7288bddbae7f47e949512ac4bcd126c2f504be2ac701158b"
end
def install
args = %W[
-verbose
-prefix #{prefix}
-release
-opensource -confirm-license
-system-zlib
-qt-libpng
-qt-libjpeg
-qt-freetype
-qt-pcre
-nomake tests
-no-rpath
-pkg-config
-dbus-runtime
]
args << "-nomake" << "examples" if build.without? "examples"
if build.with? "mysql"
args << "-plugin-sql-mysql"
(buildpath/"brew_shim/mysql_config").write <<~EOS
#!/bin/sh
if [ x"$1" = x"--libs" ]; then
mysql_config --libs | sed "s/-lssl -lcrypto//"
else
exec mysql_config "$@"
fi
EOS
chmod 0755, "brew_shim/mysql_config"
args << "-mysql_config" << buildpath/"brew_shim/mysql_config"
end
args << "-plugin-sql-psql" if build.with? "postgresql"
args << "-proprietary-codecs" if build.with? "proprietary-codecs"
system "./configure", *args
system "make"
ENV.deparallelize
system "make", "install"
if build.with? "docs"
system "make", "docs"
system "make", "install_docs"
end
# Some config scripts will only find Qt in a "Frameworks" folder
frameworks.install_symlink Dir["#{lib}/*.framework"]
# The pkg-config files installed suggest that headers can be found in the
# `include` directory. Make this so by creating symlinks from `include` to
# the Frameworks' Headers folders.
Pathname.glob("#{lib}/*.framework/Headers") do |path|
include.install_symlink path => path.parent.basename(".framework")
end
# Move `*.app` bundles into `libexec` to expose them to `brew linkapps` and
# because we don't like having them in `bin`.
# (Note: This move breaks invocation of Assistant via the Help menu
# of both Designer and Linguist as that relies on Assistant being in `bin`.)
libexec.mkpath
Pathname.glob("#{bin}/*.app") { |app| mv app, libexec }
end
def caveats; <<~EOS
We agreed to the Qt opensource license for you.
If this is unacceptable you should uninstall.
EOS
end
test do
(testpath/"hello.pro").write <<~EOS
QT += core
QT -= gui
TARGET = hello
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
EOS
(testpath/"main.cpp").write <<~EOS
#include <QCoreApplication>
#include <QDebug>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << "Hello World!";
return 0;
}
EOS
system bin/"qmake", testpath/"hello.pro"
system "make"
assert_predicate testpath/"hello", :exist?
assert_predicate testpath/"main.o", :exist?
system "./hello"
end
end

View File

@ -5,11 +5,12 @@ set -e
OSTYPE=$(uname)
if [ "${OSTYPE}" != "Darwin" ]; then
echo "[obs-websocket - Error] macOS package script can be run on Darwin-type OS only."
exit 1
echo "[obs-websocket - Error] macOS package script can be run on Darwin-type OS only."
exit 1
fi
echo "[obs-websocket] Preparing package build"
export QT_CELLAR_PREFIX="$(/usr/bin/find /usr/local/Cellar/qt -d 1 | sort -t '.' -k 1,1n -k 2,2n -k 3,3n | tail -n 1)"
GIT_HASH=$(git rev-parse --short HEAD)
GIT_BRANCH_OR_TAG=$(git name-rev --name-only HEAD | awk -F/ '{print $NF}')
@ -19,23 +20,23 @@ VERSION="$GIT_HASH-$GIT_BRANCH_OR_TAG"
FILENAME_UNSIGNED="obs-websocket-$VERSION-Unsigned.pkg"
FILENAME="obs-websocket-$VERSION.pkg"
echo "[obs-websocket] Modifying obs-websocket-compat.so linking"
echo "[obs-websocket] Modifying obs-websocket.so"
install_name_tool \
-change /tmp/obsdeps/lib/QtWidgets.framework/Versions/5/QtWidgets \
-change /usr/local/opt/qt/lib/QtWidgets.framework/Versions/5/QtWidgets \
@executable_path/../Frameworks/QtWidgets.framework/Versions/5/QtWidgets \
-change /tmp/obsdeps/lib/QtGui.framework/Versions/5/QtGui \
-change /usr/local/opt/qt/lib/QtGui.framework/Versions/5/QtGui \
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui \
-change /tmp/obsdeps/lib/QtCore.framework/Versions/5/QtCore \
-change /usr/local/opt/qt/lib/QtCore.framework/Versions/5/QtCore \
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore \
./build/obs-websocket-compat.so
./build/obs-websocket.so
# Check if replacement worked
echo "[obs-websocket] Dependencies for obs-websocket"
otool -L ./build/obs-websocket-compat.so
otool -L ./build/obs-websocket.so
if [[ "$RELEASE_MODE" == "True" ]]; then
echo "[obs-websocket] Signing plugin binary: obs-websocket-compat.so"
codesign --sign "$CODE_SIGNING_IDENTITY" ./build/obs-websocket-compat.so
echo "[obs-websocket] Signing plugin binary: obs-websocket.so"
codesign --sign "$CODE_SIGNING_IDENTITY" ./build/obs-websocket.so
else
echo "[obs-websocket] Skipped plugin codesigning"
fi
@ -44,7 +45,7 @@ echo "[obs-websocket] Actual package build"
packagesbuild ./CI/macos/obs-websocket.pkgproj
echo "[obs-websocket] Renaming obs-websocket.pkg to $FILENAME"
mv ./release/obs-websocket-compat.pkg ./release/$FILENAME_UNSIGNED
mv ./release/obs-websocket.pkg ./release/$FILENAME_UNSIGNED
if [[ "$RELEASE_MODE" == "True" ]]; then
echo "[obs-websocket] Signing installer: $FILENAME"

View File

@ -7,18 +7,18 @@ export PKG_VERSION="1-$GIT_HASH-$BRANCH_SHORT_NAME-git"
if [[ $BRANCH_FULL_NAME =~ ^refs/tags/ ]]; then
export PKG_VERSION="$BRANCH_SHORT_NAME"
echo "[obs-websocket] Branch is a tag. Setting version to $PKG_VERSION."
echo "[obs-websocket] Branch is a tag. Setting version to `$PKG_VERSION`."
fi
cd ./build
PAGER="cat" sudo checkinstall -y --type=debian --fstrans=no --nodoc \
--backup=no --deldoc=yes --install=no \
--pkgname=obs-websocket-compat --pkgversion="$PKG_VERSION" \
--pkgname=obs-websocket --pkgversion="$PKG_VERSION" \
--pkglicense="GPLv2.0" --maintainer="stephane.lepin@gmail.com" \
--pkggroup="video" \
--pkgsource="https://github.com/Palakis/obs-websocket" \
--requires="obs-studio \(\>= 26.1.0\), libqt5core5a, libqt5widgets5, qt5-image-formats-plugins" \
--requires="obs-studio \(\>= 25.0.7\), libqt5core5a, libqt5widgets5, qt5-image-formats-plugins" \
--pakdir="../package"
sudo chmod ao+r ../package/*

View File

@ -0,0 +1,37 @@
@echo off
SETLOCAL EnableDelayedExpansion
REM If obs-studio directory does not exist, clone the git repo
if not exist %OBSPath% (
echo obs-studio directory does not exist
git clone https://github.com/obsproject/obs-studio %OBSPath%
cd /D %OBSPath%\
git describe --tags --abbrev=0 --exclude="*-rc*" > "%OBSPath%\obs-studio-latest-tag.txt"
set /p OBSLatestTag=<"%OBSPath%\obs-studio-latest-tag.txt"
)
REM Prepare OBS Studio builds
echo Running CMake...
cd /D %OBSPath%
echo git checkout %OBSLatestTag%
git checkout %OBSLatestTag%
echo:
if not exist build32 mkdir build32
if not exist build64 mkdir build64
echo Running cmake for obs-studio %OBSLatestTag% 32-bit...
cd build32
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DDepsPath="%DepsPath32%" -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
echo:
echo:
echo Running cmake for obs-studio %OBSLatestTag% 64-bit...
cd ..\build64
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DDepsPath="%DepsPath64%" -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
echo:
echo:
dir "%OBSPath%\libobs"

7
CI/prepare-windows.cmd Normal file
View File

@ -0,0 +1,7 @@
mkdir build32
mkdir build64
cd build32
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DLibObs_DIR="%OBSPath%\build32\libobs" -DLIBOBS_INCLUDE_DIR="%OBSPath%\libobs" -DLIBOBS_LIB="%OBSPath%\build32\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBSPath%\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
cd ..\build64
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DLibObs_DIR="%OBSPath%\build64\libobs" -DLIBOBS_INCLUDE_DIR="%OBSPath%\libobs" -DLIBOBS_LIB="%OBSPath%\build64\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBSPath%\build64\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..

View File

@ -1,7 +0,0 @@
if exist %DEPS_BASE_PATH% (
echo "OBS dependencies found. Download skipped."
) else (
echo "OBS dependencies not found. Downloading..."
curl -o %DEPS_BASE_PATH%.zip -kLO https://cdn-fastly.obsproject.com/downloads/dependencies2019.zip -f --retry 5 -C -
7z x %DEPS_BASE_PATH%.zip -o%DEPS_BASE_PATH%
)

View File

@ -1,8 +0,0 @@
if exist %QT_BASE_DIR% (
echo "Qt directory found. Download skipped."
) else (
echo "Qt directory not found. Downloading..."
curl -kLO https://tt2468.net/dl/Qt_5.15.2.7z -f --retry 5 -C -
7z x Qt_5.15.2.7z -o%QT_BASE_DIR%
)
dir %QT_BASE_DIR%

View File

@ -1,38 +0,0 @@
@echo off
SETLOCAL EnableDelayedExpansion
REM If obs-studio directory does not exist, clone the git repo
if not exist %OBS_PATH% (
echo obs-studio directory does not exist
git clone -b 27.1.3 https://github.com/obsproject/obs-studio %OBS_PATH%
cd /D %OBS_PATH%\
git describe --tags --abbrev=0 > "%OBS_PATH%\obs-studio-latest-tag.txt"
REM set /p OBS_LATEST_TAG=<"%OBS_PATH%\obs-studio-latest-tag.txt"
set /p OBS_LATEST_TAG=<"27.1.3"
)
REM Prepare OBS Studio builds
echo Running CMake...
cd /D %OBS_PATH%
REM echo git checkout %OBS_LATEST_TAG%
REM git checkout %OBS_LATEST_TAG%
echo:
if not exist build32 mkdir build32
if not exist build64 mkdir build64
echo Running cmake for obs-studio %OBS_LATEST_TAG% 32-bit...
cd build32
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DDepsPath="%DEPS_PATH_32%" -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
echo:
echo:
echo Running cmake for obs-studio %OBS_LATEST_TAG% 64-bit...
cd ..\build64
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DDepsPath="%DEPS_PATH_64%" -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
echo:
echo:
dir "%OBS_PATH%\libobs"

View File

@ -1,7 +0,0 @@
mkdir build32
mkdir build64
cd build32
cmake -G "Visual Studio 16 2019" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR32%" -DLibObs_DIR="%OBS_PATH%\build32\libobs" -DLIBOBS_INCLUDE_DIR="%OBS_PATH%\libobs" -DLIBOBS_LIB="%OBS_PATH%\build32\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBS_PATH%\build32\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..
cd ..\build64
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0 -DQTDIR="%QTDIR64%" -DLibObs_DIR="%OBS_PATH%\build64\libobs" -DLIBOBS_INCLUDE_DIR="%OBS_PATH%\libobs" -DLIBOBS_LIB="%OBS_PATH%\build64\libobs\%build_config%\obs.lib" -DOBS_FRONTEND_LIB="%OBS_PATH%\build64\UI\obs-frontend-api\%build_config%\obs-frontend-api.lib" ..

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.5)
project(obs-websocket-compat VERSION 4.9.1)
project(obs-websocket VERSION 4.9.0)
set(CMAKE_PREFIX_PATH "${QTDIR}")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@ -22,7 +22,7 @@ endif()
find_package(LibObs REQUIRED)
find_package(Qt5 REQUIRED COMPONENTS Core Widgets)
set(obs-websocket-compat_SOURCES
set(obs-websocket_SOURCES
src/obs-websocket.cpp
src/WSServer.cpp
src/ConnectionProperties.cpp
@ -36,7 +36,6 @@ set(obs-websocket-compat_SOURCES
src/WSRequestHandler_SceneItems.cpp
src/WSRequestHandler_Sources.cpp
src/WSRequestHandler_Streaming.cpp
src/WSRequestHandler_VirtualCam.cpp
src/WSRequestHandler_StudioMode.cpp
src/WSRequestHandler_Transitions.cpp
src/WSRequestHandler_Outputs.cpp
@ -50,7 +49,7 @@ set(obs-websocket-compat_SOURCES
src/protocol/OBSRemoteProtocol.cpp
src/forms/settings-dialog.cpp)
set(obs-websocket-compat_HEADERS
set(obs-websocket_HEADERS
src/obs-websocket.h
src/WSServer.h
src/ConnectionProperties.h
@ -65,18 +64,18 @@ set(obs-websocket-compat_HEADERS
src/forms/settings-dialog.h)
# --- Platform-independent build settings ---
add_library(obs-websocket-compat MODULE
${obs-websocket-compat_SOURCES}
${obs-websocket-compat_HEADERS})
add_library(obs-websocket MODULE
${obs-websocket_SOURCES}
${obs-websocket_HEADERS})
include_directories(
"${LIBOBS_INCLUDE_DIR}/../UI/obs-frontend-api"
${Qt5Core_INCLUDES}
${Qt5Widgets_INCLUDES}
"${CMAKE_CURRENT_SOURCE_DIR}/deps/asio/asio/include"
"${CMAKE_CURRENT_SOURCE_DIR}/deps/websocketpp")
"${CMAKE_SOURCE_DIR}/deps/asio/asio/include"
"${CMAKE_SOURCE_DIR}/deps/websocketpp")
target_link_libraries(obs-websocket-compat
target_link_libraries(obs-websocket
libobs
Qt5::Core
Qt5::Widgets)
@ -85,9 +84,9 @@ target_link_libraries(obs-websocket-compat
# --- Windows-specific build settings and tasks ---
if(WIN32)
set(OBS_FRONTEND_LIB "NOTFOUND" CACHE FILEPATH "OBS frontend library")
if(OBS_FRONTEND_LIB STREQUAL "NOTFOUND")
message(FATAL_ERROR "OBS Frontend API library not found!")
if(NOT DEFINED OBS_FRONTEND_LIB)
set(OBS_FRONTEND_LIB "OBS_FRONTEND_LIB-NOTFOUND" CACHE FILEPATH "OBS frontend library")
message(FATAL_ERROR "Could not find OBS Frontend API's library !")
endif()
if(MSVC)
@ -109,62 +108,75 @@ if(WIN32)
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/UI"
)
target_link_libraries(obs-websocket-compat
target_link_libraries(obs-websocket
"${OBS_FRONTEND_LIB}")
# --- Release package helper ---
# The "release" folder has a structure similar OBS' one on Windows
set(RELEASE_DIR "${PROJECT_SOURCE_DIR}/release")
add_custom_command(TARGET obs-websocket-compat POST_BUILD
# If config is Release or RelWithDebInfo, package release files
COMMAND if $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>==1 (
add_custom_command(TARGET obs-websocket POST_BUILD
# If config is Release, package release files
COMMAND if $<CONFIG:Release>==1 (
"${CMAKE_COMMAND}" -E make_directory
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}"
)
"${RELEASE_DIR}/data/obs-plugins/obs-websocket"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}")
COMMAND if $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>==1 (
"${CMAKE_COMMAND}" -E copy_directory
COMMAND if $<CONFIG:Release>==1 ("${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/data"
"${RELEASE_DIR}/data/obs-plugins/obs-websocket-compat"
)
"${RELEASE_DIR}/data/obs-plugins/obs-websocket")
COMMAND if $<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>==1 (
COMMAND if $<CONFIG:Release>==1 ("${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:obs-websocket>"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}")
# In Release mode, copy Qt image format plugins
COMMAND if $<CONFIG:Release>==1 (
"${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:obs-websocket-compat>"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}"
)
# If config is RelWithDebInfo, package PDB file for target
"${QTDIR}/plugins/imageformats/qjpeg.dll"
"${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll")
COMMAND if $<CONFIG:RelWithDebInfo>==1 (
"${CMAKE_COMMAND}" -E copy
"$<TARGET_PDB_FILE:obs-websocket-compat>"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}"
)
"${QTDIR}/plugins/imageformats/qjpeg.dll"
"${RELEASE_DIR}/bin/${ARCH_NAME}/imageformats/qjpeg.dll")
# In the Debug configuration, copy to obs-studio dev environment for immediate testing
# If config is RelWithDebInfo, package release files
COMMAND if $<CONFIG:RelWithDebInfo>==1 (
"${CMAKE_COMMAND}" -E make_directory
"${RELEASE_DIR}/data/obs-plugins/obs-websocket"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}")
COMMAND if $<CONFIG:RelWithDebInfo>==1 ("${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/data"
"${RELEASE_DIR}/data/obs-plugins/obs-websocket")
COMMAND if $<CONFIG:RelWithDebInfo>==1 ("${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:obs-websocket>"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}")
COMMAND if $<CONFIG:RelWithDebInfo>==1 ("${CMAKE_COMMAND}" -E copy
"$<TARGET_PDB_FILE:obs-websocket>"
"${RELEASE_DIR}/obs-plugins/${ARCH_NAME}")
# Copy to obs-studio dev environment for immediate testing
COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E copy
"$<TARGET_FILE:obs-websocket-compat>"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${ARCH_NAME}"
)
"$<TARGET_FILE:obs-websocket>"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${ARCH_NAME}")
COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E copy
"$<TARGET_PDB_FILE:obs-websocket-compat>"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${ARCH_NAME}"
)
"$<TARGET_PDB_FILE:obs-websocket>"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/obs-plugins/${ARCH_NAME}")
COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E make_directory
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-websocket-compat"
)
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-websocket")
COMMAND if $<CONFIG:Debug>==1 (
"${CMAKE_COMMAND}" -E copy_directory
"${PROJECT_SOURCE_DIR}/data"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-websocket-compat"
)
"${PROJECT_SOURCE_DIR}/data"
"${LIBOBS_INCLUDE_DIR}/../${OBS_BUILDDIR_ARCH}/rundir/$<CONFIG>/data/obs-plugins/obs-websocket")
)
# --- End of sub-section ---
@ -175,28 +187,25 @@ endif()
if(UNIX AND NOT APPLE)
include(GNUInstallDirs)
set_target_properties(obs-websocket-compat PROPERTIES PREFIX "")
target_link_libraries(obs-websocket-compat obs-frontend-api)
set_target_properties(obs-websocket PROPERTIES PREFIX "")
target_link_libraries(obs-websocket obs-frontend-api)
file(GLOB locale_files data/locale/*.ini)
set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
set(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS
OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
if(${USE_UBUNTU_FIX})
install(TARGETS obs-websocket-compat LIBRARY
install(TARGETS obs-websocket LIBRARY
DESTINATION "/usr/lib/obs-plugins"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
endif()
install(TARGETS obs-websocket-compat LIBRARY
install(TARGETS obs-websocket LIBRARY
DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/obs-plugins"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
install(FILES ${locale_files}
DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/obs/obs-plugins/obs-websocket-compat/locale")
DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/obs/obs-plugins/obs-websocket/locale")
endif()
# --- End of section ---
@ -205,7 +214,7 @@ if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fvisibility=default")
set(CMAKE_SKIP_RPATH TRUE)
set_target_properties(obs-websocket-compat PROPERTIES PREFIX "")
target_link_libraries(obs-websocket-compat "${OBS_FRONTEND_LIB}")
set_target_properties(obs-websocket PROPERTIES PREFIX "")
target_link_libraries(obs-websocket "${OBS_FRONTEND_LIB}")
endif()
# -- End of section --

View File

@ -1,5 +1,9 @@
# obs-websocket
<p align="center">
<img src="/.github/images/obsws_logo.png" width=150 align="center">
</p>
WebSockets API for OBS Studio.
[![Build Status](https://dev.azure.com/Palakis/obs-websocket/_apis/build/status/Palakis.obs-websocket?branchName=4.x-current)](https://dev.azure.com/Palakis/obs-websocket/_build/latest?definitionId=2&branchName=4.x-current)
@ -48,13 +52,10 @@ Here's a list of available language APIs for obs-websocket :
- Python 3.6+ with asyncio: [simpleobsws](https://github.com/IRLToolkit/simpleobsws) by tt2468
- Java 8+: [obs-websocket-java](https://github.com/Twasi/websocket-obs-java) by TwasiNET
- Java 11+: [obs-java-client](https://github.com/harm27/obs-java-client) by harm27
- Go: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf
- Go: [goobs](https://github.com/andreykaipov/goobs) by Andrey Kaipov
- Golang: [go-obs-websocket](https://github.com/christopher-dG/go-obs-websocket) by Chris de Graaf
- Rust: [obws](https://github.com/dnaka91/obws) by dnaka91
- Dart: [obs_websocket](https://pub.dev/packages/obs_websocket) by faithoflifedev
- HTTP API: [obs-websocket-http](https://github.com/IRLToolkit/obs-websocket-http) by tt2468
- CLI: [obs-cli](https://github.com/leafac/obs-cli) by leafac
- Godot: [obs-websocket-gd](https://github.com/you-win/obs-websocket-gd) by you-win
I'd like to know what you're building with or for obs-websocket. If you do something in this fashion, feel free to drop a message in `#project-showoff` in the [discord server!](https://discord.gg/WBaSQ3A)

View File

@ -5,7 +5,6 @@ trigger:
branches:
include:
- '4.x-current'
- '4.x-compat'
tags:
include:
- '*'
@ -34,95 +33,84 @@ jobs:
vmImage: 'windows-2019'
variables:
build_config: RelWithDebInfo
DEPS_CACHE_VERSION: '1' # Change whenever updating OBS dependencies URL, in order to force a cache reset
DEPS_BASE_PATH: 'D:\obsdependencies'
DEPS_PATH_32: '$(DEPS_BASE_PATH)\win32'
DEPS_PATH_64: '$(DEPS_BASE_PATH)\win64'
QT_CACHE_VERSION: '1' # Change whenever updating Qt dependency URL, in order to force a cache reset
QT_BASE_DIR: 'D:\QtDep'
QTDIR32: '$(QT_BASE_DIR)\5.15.2\msvc2019'
QTDIR64: '$(QT_BASE_DIR)\5.15.2\msvc2019_64'
OBS_CACHE_VERSION: '1'
OBS_PATH: 'D:\obs-studio'
DepsBasePath: 'D:\obsdependencies'
DepsPath32: '$(DepsBasePath)\win32'
DepsPath64: '$(DepsBasePath)\win64'
QtBaseDir: 'D:\QtDep'
QTDIR32: '$(QtBaseDir)\5.10.1\msvc2017'
QTDIR64: '$(QtBaseDir)\5.10.1\msvc2017_64'
OBSPath: 'D:\obs-studio'
steps:
- checkout: self
submodules: true
- task: Cache@2
displayName: Restore cached Qt archive file
inputs:
key: 'qtdep-"$(QT_CACHE_VERSION)" | "$(Agent.OS)"'
restoreKeys: |
qtdep-"$(QT_CACHE_VERSION)" | "$(Agent.OS)"
path: $(QT_BASE_DIR)
- script: ./CI/windows/install-qt-win.cmd
- script: ./CI/install-qt-win.cmd
displayName: 'Install Qt'
env:
QT_BASE_DIR: $(QT_BASE_DIR)
QtBaseDir: $(QtBaseDir)
- task: Cache@2
displayName: Restore cached OBS Studio dependencies
inputs:
key: 'obsdeps-"$(DEPS_CACHE_VERSION)" | "$(Agent.OS)"'
key: 'obsdeps | "$(Agent.OS)"'
restoreKeys: |
obsdeps-"$(DEPS_CACHE_VERSION)" | "$(Agent.OS)"
path: $(DEPS_BASE_PATH)
obsdeps | "$(Agent.OS)"
path: $(DepsBasePath)
- script: ./CI/windows/download-obs-deps.cmd
- script: ./CI/download-obs-deps.cmd
displayName: 'Download OBS Studio dependencies'
- task: Cache@2
displayName: Restore cached OBS Studio builds
inputs:
key: 'obs-"$(OBS_CACHE_VERSION)" | "$(Agent.OS)"'
key: 'obs | "$(Agent.OS)"'
restoreKeys: |
obs-"$(OBS_CACHE_VERSION)" | "$(Agent.OS)"
path: $(OBS_PATH)
obs | "$(Agent.OS)"
path: $(OBSPath)
- script: ./CI/windows/prepare-obs-windows.cmd
- script: ./CI/prepare-obs-windows.cmd
displayName: 'Checkout & CMake OBS Studio'
env:
build_config: $(build_config)
DEPS_PATH_32: $(DEPS_PATH_32)
DEPS_PATH_64: $(DEPS_PATH_64)
DepsPath32: $(DepsPath32)
DepsPath64: $(DepsPath64)
QTDIR32: $(QTDIR32)
QTDIR64: $(QTDIR64)
OBS_PATH: $(OBS_PATH)
OBSPath: $(OBSPath)
- task: MSBuild@1
displayName: 'Build OBS Studio 32-bit'
inputs:
msbuildArguments: '/m /p:Configuration=$(build_config)'
solution: '$(OBS_PATH)\build32\obs-studio.sln'
solution: '$(OBSPath)\build32\obs-studio.sln'
- task: MSBuild@1
displayName: 'Build OBS Studio 64-bit'
inputs:
msbuildArguments: '/m /p:Configuration=$(build_config)'
solution: '$(OBS_PATH)\build64\obs-studio.sln'
solution: '$(OBSPath)\build64\obs-studio.sln'
- script: ./CI/windows/prepare-plugin-windows.cmd
- script: ./CI/prepare-windows.cmd
displayName: 'CMake obs-websocket'
env:
build_config: $(build_config)
QTDIR32: $(QTDIR32)
QTDIR64: $(QTDIR64)
OBS_PATH: $(OBS_PATH)
OBSPath: $(OBSPath)
- task: MSBuild@1
displayName: 'Build obs-websocket 32-bit'
inputs:
msbuildArguments: '/m /p:Configuration=$(build_config)'
solution: '.\build32\obs-websocket-compat.sln'
solution: '.\build32\obs-websocket.sln'
- task: MSBuild@1
displayName: 'Build obs-websocket 64-bit'
inputs:
msbuildArguments: '/m /p:Configuration=$(build_config)'
solution: '.\build64\obs-websocket-compat.sln'
solution: '.\build64\obs-websocket.sln'
- script: ./CI/windows/package-plugin-windows.cmd
- script: ./CI/package-windows.cmd
displayName: 'Package obs-websocket'
- task: PublishBuildArtifacts@1
@ -133,21 +121,22 @@ jobs:
- job: 'Build_Linux'
pool:
vmImage: 'ubuntu-20.04'
vmImage: 'ubuntu-18.04'
variables:
BUILD_REASON: $(Build.Reason)
BRANCH_SHORT_NAME: $(Build.SourceBranchName)
BRANCH_FULL_NAME: $(Build.SourceBranch)
steps:
- checkout: self
submodules: true
- script: ./CI/linux/install-dependencies-ubuntu.sh
- script: ./CI/install-dependencies-ubuntu.sh
displayName: 'Install dependencies'
- script: ./CI/linux/build-plugin-ubuntu.sh
- script: ./CI/build-ubuntu.sh
displayName: 'Build obs-websocket'
- script: ./CI/linux/package-plugin-ubuntu.sh
- script: ./CI/package-ubuntu.sh
displayName: 'Package obs-websocket'
- task: PublishBuildArtifacts@1
@ -157,24 +146,18 @@ jobs:
- job: 'Build_macOS'
pool:
vmImage: 'macOS-10.15'
variables:
OBS_DEPS_VERSION: '2020-12-22'
QT_VERSION: '5.15.2'
vmImage: 'macos-10.14'
steps:
- checkout: self
submodules: true
- script: ./CI/macos/install-dependencies-macos.sh
- script: ./CI/install-dependencies-macos.sh
displayName: 'Install dependencies'
env:
OBS_DEPS_VERSION: $(OBS_DEPS_VERSION)
QT_VERSION: $(QT_VERSION)
- script: ./CI/macos/install-build-obs-macos.sh
- script: ./CI/install-build-obs-macos.sh
displayName: 'Build OBS'
- script: ./CI/macos/build-plugin-macos.sh
- script: ./CI/build-macos.sh
displayName: 'Build obs-websocket'
- task: InstallAppleCertificate@2
@ -184,7 +167,7 @@ jobs:
certSecureFile: 'Certificates.p12'
certPwd: $(secrets.macOS.certificatesImportPassword)
- script: ./CI/macos/package-plugin-macos.sh
- script: ./CI/package-macos.sh
displayName: 'Package obs-websocket'
env:
RELEASE_MODE: $(isReleaseMode)

1
data/locale/ar-SA.ini Normal file
View File

@ -0,0 +1 @@

18
data/locale/de-DE.ini Normal file
View File

@ -0,0 +1,18 @@
OBSWebsocket.Settings.DialogTitle="WebSockets-Servereinstellungen"
OBSWebsocket.Settings.ServerEnable="WebSockets-Server aktivieren"
OBSWebsocket.Settings.ServerPort="Server-Port"
OBSWebsocket.Settings.AuthRequired="Authentifizierung aktivieren"
OBSWebsocket.Settings.Password="Passwort"
OBSWebsocket.Settings.LockToIPv4="Nur IPv4 verwenden (deaktiviert IPv6)"
OBSWebsocket.Settings.DebugEnable="Debug-Protokollierung aktivieren"
OBSWebsocket.Settings.AlertsEnable="Infobereichbenachrichtigungen aktivieren"
OBSWebsocket.NotifyConnect.Title="Neue Websocket-Verbindung"
OBSWebsocket.NotifyConnect.Message="Client %1 verbunden"
OBSWebsocket.NotifyDisconnect.Title="Websocket-Client getrennt"
OBSWebsocket.NotifyDisconnect.Message="Client %1 getrennt"
OBSWebsocket.Server.StartFailed.Title="Websocket-Serverfehler"
OBSWebsocket.Server.StartFailed.Message="Der WebSocket-Server konnte nicht gestartet werden, mögliche Gründe:\n - Der TCP-Port %1 wird möglicherweise gerade von einem anderen Programm verwendet. Versuchen Sie einen anderen Port in den Websocket-Servereinstellungen zu setzen oder alle Programme zu beenden, die den Port möglicherweise verwenden.\n - Fehler: %2"
OBSWebsocket.ProfileChanged.Started="WebSockets-Server in diesem Profil aktiviert. Server gestartet."
OBSWebsocket.ProfileChanged.Stopped="WebSockets-Server in diesem Profil deaktiviert. Server gestoppt."
OBSWebsocket.ProfileChanged.Restarted="WebSockets-Server in diesem Profil geändert. Server startet neu."

View File

@ -1,21 +1,21 @@
OBSWebsocketCompat.Settings.DialogTitle="WebSockets Server Settings (4.x Compat)"
OBSWebsocketCompat.Settings.ServerEnable="Enable WebSockets server"
OBSWebsocketCompat.Settings.ServerPort="Server Port"
OBSWebsocketCompat.Settings.AuthRequired="Enable authentication"
OBSWebsocketCompat.Settings.Password="Password"
OBSWebsocketCompat.Settings.LockToIPv4="Lock server to only using IPv4"
OBSWebsocketCompat.Settings.DebugEnable="Enable debug logging"
OBSWebsocketCompat.Settings.AlertsEnable="Enable System Tray Alerts"
OBSWebsocketCompat.Settings.AuthDisabledWarning="Running obs-websocket with authentication disabled is not recommended, as it allows attackers to easily collect sensetive data. Are you sure you want to proceed?"
OBSWebsocketCompat.NotifyConnect.Title="New WebSocket connection"
OBSWebsocketCompat.NotifyConnect.Message="Client %1 connected"
OBSWebsocketCompat.NotifyDisconnect.Title="WebSocket client disconnected"
OBSWebsocketCompat.NotifyDisconnect.Message="Client %1 disconnected"
OBSWebsocketCompat.Server.StartFailed.Title="WebSockets Server failure"
OBSWebsocketCompat.Server.StartFailed.Message="The WebSockets compat server failed to start, maybe because:\n - TCP port %1 may currently be in use by the main obs-websocket plugin. Try setting a different TCP port in the obs-websocket Server Settings, or stop any application that could be using this port.\n - Error message: %2"
OBSWebsocketCompat.ProfileChanged.Started="WebSockets server enabled in this profile. Server started."
OBSWebsocketCompat.ProfileChanged.Stopped="WebSockets server disabled in this profile. Server stopped."
OBSWebsocketCompat.ProfileChanged.Restarted="WebSockets server port changed in this profile. Server restarted."
OBSWebsocketCompat.InitialPasswordSetup.Title="obs-websocket - Server Password Configuration"
OBSWebsocketCompat.InitialPasswordSetup.Text="It looks like you are running obs-websocket for the first time. Do you want to configure a password now for the WebSockets server? Setting a password is highly recommended."
OBSWebsocketCompat.InitialPasswordSetup.DismissedText="You can configure a server password later in the WebSockets Server Settings. (Under the Tools menu of OBS Studio)"
OBSWebsocket.Settings.DialogTitle="WebSockets Server Settings"
OBSWebsocket.Settings.ServerEnable="Enable WebSockets server"
OBSWebsocket.Settings.ServerPort="Server Port"
OBSWebsocket.Settings.AuthRequired="Enable authentication"
OBSWebsocket.Settings.Password="Password"
OBSWebsocket.Settings.LockToIPv4="Lock server to only using IPv4"
OBSWebsocket.Settings.DebugEnable="Enable debug logging"
OBSWebsocket.Settings.AlertsEnable="Enable System Tray Alerts"
OBSWebsocket.Settings.AuthDisabledWarning="Running obs-websocket with authentication disabled is not recommended, as it allows attackers to easily collect sensetive data. Are you sure you want to proceed?"
OBSWebsocket.NotifyConnect.Title="New WebSocket connection"
OBSWebsocket.NotifyConnect.Message="Client %1 connected"
OBSWebsocket.NotifyDisconnect.Title="WebSocket client disconnected"
OBSWebsocket.NotifyDisconnect.Message="Client %1 disconnected"
OBSWebsocket.Server.StartFailed.Title="WebSockets Server failure"
OBSWebsocket.Server.StartFailed.Message="The WebSockets server failed to start, maybe because:\n - TCP port %1 may currently be in use elsewhere on this system, possibly by another application. Try setting a different TCP port in the WebSocket server settings, or stop any application that could be using this port.\n - Error message: %2"
OBSWebsocket.ProfileChanged.Started="WebSockets server enabled in this profile. Server started."
OBSWebsocket.ProfileChanged.Stopped="WebSockets server disabled in this profile. Server stopped."
OBSWebsocket.ProfileChanged.Restarted="WebSockets server port changed in this profile. Server restarted."
OBSWebsocket.InitialPasswordSetup.Title="obs-websocket - Server Password Configuration"
OBSWebsocket.InitialPasswordSetup.Text="It looks like you are running obs-websocket for the first time. Do you want to configure a password now for the WebSockets server? Setting a password is highly recommended."
OBSWebsocket.InitialPasswordSetup.DismissedText="You can configure a server password later in the WebSockets Server Settings. (Under the Tools menu of OBS Studio)"

16
data/locale/es-ES.ini Normal file
View File

@ -0,0 +1,16 @@
OBSWebsocket.Settings.DialogTitle="Configuración del servidor WebSocket"
OBSWebsocket.Settings.ServerEnable="Habilitar el servidor WebSockets"
OBSWebsocket.Settings.ServerPort="Puerto del Servidor"
OBSWebsocket.Settings.AuthRequired="Habilitar autenticación"
OBSWebsocket.Settings.Password="Contraseña"
OBSWebsocket.Settings.DebugEnable="Habilitar registro de depuración"
OBSWebsocket.Settings.AlertsEnable="Habilitar alertas en la bandeja de sistema"
OBSWebsocket.NotifyConnect.Title="Nueva conexión WebSocket"
OBSWebsocket.NotifyConnect.Message="Cliente %1 conectado"
OBSWebsocket.NotifyDisconnect.Title="Cliente WebSocket desconectado"
OBSWebsocket.NotifyDisconnect.Message="Cliente %1 desconectado"
OBSWebsocket.Server.StartFailed.Title="Falla en el servidor WebSockets"
OBSWebsocket.ProfileChanged.Started="El servidor WebSocket esta habilitado en este perfil. El servidor ha iniciado."
OBSWebsocket.ProfileChanged.Stopped="Servidor WebSockets deshabilitado en este perfil. Servidor detenido."
OBSWebsocket.ProfileChanged.Restarted="Puerto del servidor WebSockets cambiado en este perfil. Servidor reiniciado."

16
data/locale/fr-FR.ini Normal file
View File

@ -0,0 +1,16 @@
OBSWebsocket.Settings.DialogTitle="Paramètres du serveur WebSockets"
OBSWebsocket.Settings.ServerEnable="Activer le serveur WebSocket"
OBSWebsocket.Settings.ServerPort="Port du serveur"
OBSWebsocket.Settings.AuthRequired="Activer l'authentification"
OBSWebsocket.Settings.Password="Mot de passe"
OBSWebsocket.Settings.DebugEnable="Débogage dans le fichier journal"
OBSWebsocket.Settings.AlertsEnable="Notifications de connexion/déconnexion"
OBSWebsocket.NotifyConnect.Title="Nouvelle connexion WebSocket"
OBSWebsocket.NotifyConnect.Message="Le client %1 s'est connecté"
OBSWebsocket.NotifyDisconnect.Title="Déconnexion WebSocket"
OBSWebsocket.NotifyDisconnect.Message="Le client %1 s'est déconnecté"
OBSWebsocket.Server.StartFailed.Title="Impossible de démarrer le serveur WebSockets"
OBSWebsocket.ProfileChanged.Started="Serveur WebSockets actif dans ce profil."
OBSWebsocket.ProfileChanged.Stopped="Serveur WebSockets désactivé dans ce profil."
OBSWebsocket.ProfileChanged.Restarted="Le port actuel diffère du port configuré dans ce profil. Serveur WebSockets redémarré."

1
data/locale/hi-IN.ini Normal file
View File

@ -0,0 +1 @@

18
data/locale/it-IT.ini Normal file
View File

@ -0,0 +1,18 @@
OBSWebsocket.Settings.DialogTitle="Impostazioni del server di WebSocket"
OBSWebsocket.Settings.ServerEnable="Abilitare il server WebSockets"
OBSWebsocket.Settings.ServerPort="Porta del server"
OBSWebsocket.Settings.AuthRequired="Abilitare l'autenticazione"
OBSWebsocket.Settings.Password="Password"
OBSWebsocket.Settings.LockToIPv4="Blocca il server per usare solo IPv4"
OBSWebsocket.Settings.DebugEnable="Attivare la registrazione di debug"
OBSWebsocket.Settings.AlertsEnable="Attivare gli avvisi di vassoio di sistema"
OBSWebsocket.NotifyConnect.Title="Nuova connessione WebSocket"
OBSWebsocket.NotifyConnect.Message="%1 cliente collegato"
OBSWebsocket.NotifyDisconnect.Title="WebSocket cliente disconnesso"
OBSWebsocket.NotifyDisconnect.Message="%1 cliente disconnesso"
OBSWebsocket.Server.StartFailed.Title="Errore del WebSocket Server"
OBSWebsocket.Server.StartFailed.Message="L'avvio del server WebSockets è fallito, forse perché:\n - La porta TCP %1 può attualmente essere in uso altrove su questo sistema, forse da un'altra applicazione. Provare a impostare una porta TCP diversa nelle impostazioni del server WebSocket o interrompere qualsiasi applicazione che potrebbe utilizzare questa porta.\n - Messaggio di errore: %2"
OBSWebsocket.ProfileChanged.Started="Server WebSockets abilitato in questo profilo. Il server è avviato."
OBSWebsocket.ProfileChanged.Stopped="Server WebSocket disabilitato in questo profilo. Server interrotto."
OBSWebsocket.ProfileChanged.Restarted="La porta del server WebSocket è stata modificata in questo profilo. Il server è stato riavviato."

16
data/locale/ja-JP.ini Normal file
View File

@ -0,0 +1,16 @@
OBSWebsocket.Settings.DialogTitle="Websocket サーバー設定"
OBSWebsocket.Settings.ServerEnable="WebSockets サーバーを有効にする"
OBSWebsocket.Settings.ServerPort="サーバーポート"
OBSWebsocket.Settings.AuthRequired="認証を有効にする"
OBSWebsocket.Settings.Password="パスワード"
OBSWebsocket.Settings.DebugEnable="デバッグログを有効にする"
OBSWebsocket.Settings.AlertsEnable="システムトレイ通知を有効にする"
OBSWebsocket.NotifyConnect.Title="新しい WebSocket 接続"
OBSWebsocket.NotifyConnect.Message="接続されているクライアント %1"
OBSWebsocket.NotifyDisconnect.Title="WebSocket クライアントが切断されました"
OBSWebsocket.NotifyDisconnect.Message="切断されたクライアント %1"
OBSWebsocket.Server.StartFailed.Title="WebSockets サーバー障害"
OBSWebsocket.ProfileChanged.Started="このプロファイルでWebSocketサーバが有効になりました。サーバを起動しました。"
OBSWebsocket.ProfileChanged.Stopped="このプロファイルでWebSocketサーバが無効になりました。サーバを停止しました。"
OBSWebsocket.ProfileChanged.Restarted="このプロファイルでWebSocketサーバの通信ポートが変更されました。サーバを再起動しました。"

18
data/locale/ko-KR.ini Normal file
View File

@ -0,0 +1,18 @@
OBSWebsocket.Settings.DialogTitle="웹소켓 서버 설정"
OBSWebsocket.Settings.ServerEnable="웹소켓 서버 활성화"
OBSWebsocket.Settings.ServerPort="서버 포트"
OBSWebsocket.Settings.AuthRequired="인증 활성화"
OBSWebsocket.Settings.Password="비밀번호"
OBSWebsocket.Settings.LockToIPv4="IPv4만 이용하여 서버를 연결"
OBSWebsocket.Settings.DebugEnable="디버그 로깅 활성화"
OBSWebsocket.Settings.AlertsEnable="시스템 트레이 알림 활성화"
OBSWebsocket.NotifyConnect.Title="새로운 웹소켓 연결"
OBSWebsocket.NotifyConnect.Message="클라이언트 %1 가 연결되었습니다"
OBSWebsocket.NotifyDisconnect.Title="웹소켓 클라이언트가 연결 해제되었습니다"
OBSWebsocket.NotifyDisconnect.Message="클라이언트 %1 가 연결이 해제되었습니다"
OBSWebsocket.Server.StartFailed.Title="웹소켓 서버 시작이 실패하였습니다"
OBSWebsocket.Server.StartFailed.Message="웹소켓 서버가 시작되지 못했습니다. \n 시스템 상의 다른 프로그램이 TCP 포트 %1을 사용 중인 것으로 보입니다. 다른 TCP 포트를 사용하거나, 해당 포트를 사용 중인 프로그램을 종료하고 다시 시도해주세요. \n 에러 메시지: %2"
OBSWebsocket.ProfileChanged.Started="프로파일 설정에 따라 웹소켓 서버가 활성화되었습니다. 서버가 시작되었습니다."
OBSWebsocket.ProfileChanged.Stopped="프로파일 설정에 따라 웹소켓 서버가 비활성화되었습니다. 서버가 중지되었습니다."
OBSWebsocket.ProfileChanged.Restarted="프로파일 설정에 따라 웹소켓 포트가 변경되었습니다. 서버가 재시작되었습니다."

18
data/locale/nl-NL.ini Normal file
View File

@ -0,0 +1,18 @@
OBSWebsocket.Settings.DialogTitle="WebSockets Server Instellingen"
OBSWebsocket.Settings.ServerEnable="WebSockets server inschakelen"
OBSWebsocket.Settings.ServerPort="Serverpoort"
OBSWebsocket.Settings.AuthRequired="Verificatie inschakelen"
OBSWebsocket.Settings.Password="Wachtwoord"
OBSWebsocket.Settings.LockToIPv4="Server vergrendelen om alleen IPv4 te gebruiken"
OBSWebsocket.Settings.DebugEnable="Activeer debug logs"
OBSWebsocket.Settings.AlertsEnable="Systemvak waarschuwingen inschakelen"
OBSWebsocket.NotifyConnect.Title="Nieuwe WebSocket verbinding"
OBSWebsocket.NotifyConnect.Message="Client %1 verbonden"
OBSWebsocket.NotifyDisconnect.Title="WebSocket client connectie verbroken"
OBSWebsocket.NotifyDisconnect.Message="Client %1 losgekoppeld"
OBSWebsocket.Server.StartFailed.Title="Fout in WebSocket server"
OBSWebsocket.Server.StartFailed.Message="De obs-websocket server kan niet worden gestart, misschien omdat: \n - TCP-poort %1 momenteel elders wordt gebruikt op dit systeem, eventueel door een andere toepassing. Probeer een andere TCP-poort in te stellen in de WebSocket Server-instellingen of stop elke toepassing die deze poort zou kunnen gebruiken.\n Een onbekende Netwerkfout op uw systeem. Probeer het opnieuw door de instellingen te wijzigen, OBS te herstarten of uw systeem te herstarten."
OBSWebsocket.ProfileChanged.Started="WebSockets server ingeschakeld in dit profiel. Server gestart."
OBSWebsocket.ProfileChanged.Stopped="WebSockets server uitgeschakeld in dit profiel. Server is gestopt."
OBSWebsocket.ProfileChanged.Restarted="WebSockets server poort is veranderd in dit profiel. Server is herstart."

15
data/locale/pl-PL.ini Normal file
View File

@ -0,0 +1,15 @@
OBSWebsocket.Settings.DialogTitle="Ustawienia serwera WebSockets"
OBSWebsocket.Settings.ServerEnable="Włącz serwer WebSockets"
OBSWebsocket.Settings.ServerPort="Port serwera"
OBSWebsocket.Settings.AuthRequired="Wymagaj uwierzytelniania"
OBSWebsocket.Settings.Password="Hasło"
OBSWebsocket.Settings.LockToIPv4="Zablokuj serwer tylko za pomocą IPv4"
OBSWebsocket.Settings.DebugEnable="Włącz rejestrowanie debugowania"
OBSWebsocket.Settings.AlertsEnable="Włącz powiadomienia w zasobniku systemowym"
OBSWebsocket.NotifyConnect.Title="Nowe połączenie WebSocket"
OBSWebsocket.NotifyConnect.Message="Klient %1 połączony"
OBSWebsocket.NotifyDisconnect.Title="Klient WebSocket odłączony"
OBSWebsocket.NotifyDisconnect.Message="Klient %1 rozłączony"
OBSWebsocket.Server.StartFailed.Title="Awaria serwera WebSockets"
OBSWebsocket.ProfileChanged.Started="Serwer WebSockets włączony w tym profilu. Serwer uruchomiony."

18
data/locale/pt-PT.ini Normal file
View File

@ -0,0 +1,18 @@
OBSWebsocket.Settings.DialogTitle="Configurações do servidor de WebSockets"
OBSWebsocket.Settings.ServerEnable="Habilitar servidor de WebSockets"
OBSWebsocket.Settings.ServerPort="Porta do Servidor"
OBSWebsocket.Settings.AuthRequired="Activar autenticação"
OBSWebsocket.Settings.Password="Palavra passe"
OBSWebsocket.Settings.LockToIPv4="Forçar apenas o uso de IPv4 (desabilitar IPv6)"
OBSWebsocket.Settings.DebugEnable="Habilitar registro de debug"
OBSWebsocket.Settings.AlertsEnable="Ativar Alertas da bandeja do sistema"
OBSWebsocket.NotifyConnect.Title="Nova conexão WebSocket"
OBSWebsocket.NotifyConnect.Message="Cliente %1 conectado"
OBSWebsocket.NotifyDisconnect.Title="WebSocket cliente desconectado"
OBSWebsocket.NotifyDisconnect.Message="Cliente %1 desconectado"
OBSWebsocket.Server.StartFailed.Title="Falha do servidor de WebSocket"
OBSWebsocket.Server.StartFailed.Message="O servidor de WebSockets falhou ao iniciar, possivelmente porque:\n - A porta TCP %1 pode já estar em uso em algum outro lugar neste sistema, possivelmente por outro aplicativo. Tente definir uma porta TCP diferente nas configurações do servidor de WebSockets, ou pare qualquer aplicativo que possa estar usando essa porta.\n - Mensagem de erro: %2"
OBSWebsocket.ProfileChanged.Started="Servidor de WebSockets habilitado nesse perfil. Servidor iniciado."
OBSWebsocket.ProfileChanged.Stopped="Servidor de WebSockets desabilitado nesse perfil. Servidor parado."
OBSWebsocket.ProfileChanged.Restarted="Porta do servidor de WebSockets foi alterada neste perfil. Servidor reiniciado."

18
data/locale/ru-RU.ini Normal file
View File

@ -0,0 +1,18 @@
OBSWebsocket.Settings.DialogTitle="Настройки сервера WebSockets"
OBSWebsocket.Settings.ServerEnable="Включить сервер WebSockets"
OBSWebsocket.Settings.ServerPort="Порт сервера"
OBSWebsocket.Settings.AuthRequired="Включить авторизацию"
OBSWebsocket.Settings.Password="Пароль"
OBSWebsocket.Settings.LockToIPv4="Блокировка сервера только с использованием IPv4"
OBSWebsocket.Settings.DebugEnable="Включить ведение журнала отладки"
OBSWebsocket.Settings.AlertsEnable="Включить оповещения в системном трее"
OBSWebsocket.NotifyConnect.Title="Новое соединение WebSocket"
OBSWebsocket.NotifyConnect.Message="Клиент %1 подключен"
OBSWebsocket.NotifyDisconnect.Title="Клиент WebSocket отключён"
OBSWebsocket.NotifyDisconnect.Message="Клиент %1 отключен"
OBSWebsocket.Server.StartFailed.Title="Сбой сервера WebSockets"
OBSWebsocket.Server.StartFailed.Message="Сервер WebSockets не запустился, возможно, потому, что:\n-TCP-порт %1 в настоящее время может использоваться в другом месте этой системы, возможно, другим приложением. Попробуйте установить другой TCP-порт в настройках сервера WebSocket или остановить любое приложение, которое может использовать этот порт.\n-сообщение об ошибке: %2"
OBSWebsocket.ProfileChanged.Started="Сервер WebSockets включен в этом профиле. Сервер запущен."
OBSWebsocket.ProfileChanged.Stopped="Сервер WebSockets отключен в этом профиле. Сервер остановлен."
OBSWebsocket.ProfileChanged.Restarted="Порт сервера WebSockets изменен в этом профиле. Сервер перезапущен."

16
data/locale/zh-CN.ini Normal file
View File

@ -0,0 +1,16 @@
OBSWebsocket.Settings.DialogTitle="WebSockets 服务器设置"
OBSWebsocket.Settings.ServerEnable="启用 WebSockets 服务器"
OBSWebsocket.Settings.ServerPort="服务器端口"
OBSWebsocket.Settings.AuthRequired="启用身份验证"
OBSWebsocket.Settings.Password="密码"
OBSWebsocket.Settings.DebugEnable="启用调试日志"
OBSWebsocket.Settings.AlertsEnable="启用系统托盘通知"
OBSWebsocket.NotifyConnect.Title="新 WebSocket 连接"
OBSWebsocket.NotifyConnect.Message="客户端 %1 已连接"
OBSWebsocket.NotifyDisconnect.Title="WebSocket 客户端已断开"
OBSWebsocket.NotifyDisconnect.Message="客户端 %1 已断开连接"
OBSWebsocket.Server.StartFailed.Title="WebSockets 服务器错误"
OBSWebsocket.ProfileChanged.Started="此配置文件中启用了 WebSockets 服务器。服务器已启动。"
OBSWebsocket.ProfileChanged.Stopped="此配置文件中禁用了 WebSockets 服务器。服务器已停止。"
OBSWebsocket.ProfileChanged.Restarted="此配置文件中的 WebSockets 服务器端口已更改。服务器已重新启动。"

9
data/locale/zh-TW.ini Normal file
View File

@ -0,0 +1,9 @@
OBSWebsocket.Settings.ServerPort="伺服器連接埠"
OBSWebsocket.Settings.DebugEnable="啟用除錯日誌"
OBSWebsocket.Settings.AlertsEnable="啟用系統列通知"
OBSWebsocket.NotifyConnect.Title="新的 WebSocket 連線"
OBSWebsocket.NotifyConnect.Message="客戶端 %1 已連線"
OBSWebsocket.NotifyDisconnect.Title="WebSocket 客戶端已離線"
OBSWebsocket.NotifyDisconnect.Message="客戶端 %1 已離線"
OBSWebsocket.Server.StartFailed.Title="WebSocket 伺服器錯誤"

View File

@ -127,7 +127,6 @@
"{double} `rotation` The clockwise rotation of the scene item in degrees around the point of alignment.",
"{double} `scale.x` The x-scale factor of the scene item.",
"{double} `scale.y` The y-scale factor of the scene item.",
"{String} `scale.filter` The scale filter of the source. Can be \"OBS_SCALE_DISABLE\", \"OBS_SCALE_POINT\", \"OBS_SCALE_BICUBIC\", \"OBS_SCALE_BILINEAR\", \"OBS_SCALE_LANCZOS\" or \"OBS_SCALE_AREA\".",
"{int} `crop.top` The number of pixels cropped off the top of the scene item before scaling.",
"{int} `crop.right` The number of pixels cropped off the right of the scene item before scaling.",
"{int} `crop.bottom` The number of pixels cropped off the bottom of the scene item before scaling.",
@ -176,11 +175,6 @@
"name": "scale.y",
"description": "The y-scale factor of the scene item."
},
{
"type": "String",
"name": "scale.filter",
"description": "The scale filter of the source. Can be \"OBS_SCALE_DISABLE\", \"OBS_SCALE_POINT\", \"OBS_SCALE_BICUBIC\", \"OBS_SCALE_BILINEAR\", \"OBS_SCALE_LANCZOS\" or \"OBS_SCALE_AREA\"."
},
{
"type": "int",
"name": "crop.top",
@ -366,7 +360,7 @@
"{boolean} `flags.encoded` Output is encoded",
"{boolean} `flags.multiTrack` Output uses several audio tracks",
"{boolean} `flags.service` Output uses a service",
"{Object} `settings` Output settings",
"{Object} `settings` Output name",
"{boolean} `active` Output status (active or not)",
"{boolean} `reconnecting` Output reconnection status (reconnecting or not)",
"{double} `congestion` Output congestion",
@ -433,7 +427,7 @@
{
"type": "Object",
"name": "settings",
"description": "Output settings"
"description": "Output name"
},
{
"type": "boolean",
@ -861,7 +855,7 @@
"{String} `name` Transition name.",
"{String} `type` Transition type.",
"{int} `duration` Transition duration (in milliseconds). Will be -1 for any transition with a fixed duration, such as a Stinger, due to limitations of the OBS API.",
"{String (optional)} `from-scene` Source scene of the transition",
"{String} `from-scene` Source scene of the transition",
"{String} `to-scene` Destination scene of the transition"
],
"api": "events",
@ -885,7 +879,7 @@
"description": "Transition duration (in milliseconds). Will be -1 for any transition with a fixed duration, such as a Stinger, due to limitations of the OBS API."
},
{
"type": "String (optional)",
"type": "String",
"name": "from-scene",
"description": "Source scene of the transition"
},
@ -989,7 +983,7 @@
"{String} `name` Transition name.",
"{String} `type` Transition type.",
"{int} `duration` Transition duration (in milliseconds).",
"{String (optional)} `from-scene` Source scene of the transition",
"{String} `from-scene` Source scene of the transition",
"{String} `to-scene` Destination scene of the transition"
],
"api": "events",
@ -1013,7 +1007,7 @@
"description": "Transition duration (in milliseconds)."
},
{
"type": "String (optional)",
"type": "String",
"name": "from-scene",
"description": "Source scene of the transition"
},
@ -1667,74 +1661,6 @@
"examples": []
}
],
"virtual cam": [
{
"subheads": [],
"description": "Virtual cam started successfully.",
"api": "events",
"name": "VirtualCamStarted",
"category": "virtual cam",
"since": "4.9.1",
"names": [
{
"name": "",
"description": "VirtualCamStarted"
}
],
"categories": [
{
"name": "",
"description": "virtual cam"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "VirtualCamStarted"
},
"lead": "",
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Virtual cam stopped successfully.",
"api": "events",
"name": "VirtualCamStopped",
"category": "virtual cam",
"since": "4.9.1",
"names": [
{
"name": "",
"description": "VirtualCamStopped"
}
],
"categories": [
{
"name": "",
"description": "virtual cam"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "VirtualCamStopped"
},
"lead": "",
"type": "class",
"examples": []
}
],
"replay buffer": [
{
"subheads": [],
@ -2186,8 +2112,7 @@
"description": "The volume of a source has changed.",
"return": [
"{String} `sourceName` Source name",
"{float} `volume` Source volume",
"{float} `volumeDb` Source volume in Decibel"
"{float} `volume` Source volume"
],
"api": "events",
"name": "SourceVolumeChanged",
@ -2203,11 +2128,6 @@
"type": "float",
"name": "volume",
"description": "Source volume"
},
{
"type": "float",
"name": "volumeDb",
"description": "Source volume in Decibel"
}
],
"names": [
@ -4469,56 +4389,15 @@
"lead": "",
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Waits for the specified duration. Designed to be used in `ExecuteBatch` operations.",
"param": "{int} `sleepMillis` Delay in milliseconds to wait before continuing.",
"api": "requests",
"name": "Sleep",
"category": "general",
"since": "4.9.1",
"params": [
{
"type": "int",
"name": "sleepMillis",
"description": "Delay in milliseconds to wait before continuing."
}
],
"names": [
{
"name": "",
"description": "Sleep"
}
],
"categories": [
{
"name": "",
"description": "general"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "Sleep"
},
"lead": "",
"type": "class",
"examples": []
}
],
"media control": [
{
"subheads": [],
"description": "Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)\nNote :Leaving out `playPause` toggles the current pause state",
"description": "Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)",
"param": [
"{String} `sourceName` Source name.",
"{boolean} `playPause` (optional) Whether to pause or play the source. `false` for play, `true` for pause."
"{boolean} `playPause` Whether to pause or play the source. `false` for play, `true` for pause."
],
"api": "requests",
"name": "PlayPauseMedia",
@ -4533,7 +4412,7 @@
{
"type": "boolean",
"name": "playPause",
"description": "(optional) Whether to pause or play the source. `false` for play, `true` for pause."
"description": "Whether to pause or play the source. `false` for play, `true` for pause."
}
],
"names": [
@ -5411,142 +5290,6 @@
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Changes whether an audio track is active for a source.",
"param": [
"{String} `sourceName` Source name.",
"{int} `track` Audio tracks 1-6.",
"{boolean} `active` Whether audio track is active or not."
],
"api": "requests",
"name": "SetAudioTracks",
"category": "sources",
"since": "4.9.1",
"params": [
{
"type": "String",
"name": "sourceName",
"description": "Source name."
},
{
"type": "int",
"name": "track",
"description": "Audio tracks 1-6."
},
{
"type": "boolean",
"name": "active",
"description": "Whether audio track is active or not."
}
],
"names": [
{
"name": "",
"description": "SetAudioTracks"
}
],
"categories": [
{
"name": "",
"description": "sources"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "SetAudioTracks"
},
"lead": "",
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Gets whether an audio track is active for a source.",
"param": "{String} `sourceName` Source name.",
"return": [
"{boolean} `track1`",
"{boolean} `track2`",
"{boolean} `track3`",
"{boolean} `track4`",
"{boolean} `track5`",
"{boolean} `track6`"
],
"api": "requests",
"name": "GetAudioTracks",
"category": "sources",
"since": "4.9.1",
"returns": [
{
"type": "boolean",
"name": "track1",
"description": ""
},
{
"type": "boolean",
"name": "track2",
"description": ""
},
{
"type": "boolean",
"name": "track3",
"description": ""
},
{
"type": "boolean",
"name": "track4",
"description": ""
},
{
"type": "boolean",
"name": "track5",
"description": ""
},
{
"type": "boolean",
"name": "track6",
"description": ""
}
],
"params": [
{
"type": "String",
"name": "sourceName",
"description": "Source name."
}
],
"names": [
{
"name": "",
"description": "GetAudioTracks"
}
],
"categories": [
{
"name": "",
"description": "sources"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "GetAudioTracks"
},
"lead": "",
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Get the mute status of a specified source.",
@ -5694,55 +5437,6 @@
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Get the source's active status of a specified source (if it is showing in the final mix).",
"param": "{String} `sourceName` Source name.",
"return": "{boolean} `sourceActive` Source active status of the source.",
"api": "requests",
"name": "GetSourceActive",
"category": "sources",
"since": "4.9.1",
"returns": [
{
"type": "boolean",
"name": "sourceActive",
"description": "Source active status of the source."
}
],
"params": [
{
"type": "String",
"name": "sourceName",
"description": "Source name."
}
],
"names": [
{
"name": "",
"description": "GetSourceActive"
}
],
"categories": [
{
"name": "",
"description": "sources"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "GetSourceActive"
},
"lead": "",
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Get the audio's active status of a specified source.",
@ -8875,7 +8569,6 @@
"{double} `rotation` The clockwise rotation of the item in degrees around the point of alignment.",
"{double} `scale.x` The x-scale factor of the source.",
"{double} `scale.y` The y-scale factor of the source.",
"{String} `scale.filter` The scale filter of the source. Can be \"OBS_SCALE_DISABLE\", \"OBS_SCALE_POINT\", \"OBS_SCALE_BICUBIC\", \"OBS_SCALE_BILINEAR\", \"OBS_SCALE_LANCZOS\" or \"OBS_SCALE_AREA\".",
"{int} `crop.top` The number of pixels cropped off the top of the source before scaling.",
"{int} `crop.right` The number of pixels cropped off the right of the source before scaling.",
"{int} `crop.bottom` The number of pixels cropped off the bottom of the source before scaling.",
@ -8939,11 +8632,6 @@
"name": "scale.y",
"description": "The y-scale factor of the source."
},
{
"type": "String",
"name": "scale.filter",
"description": "The scale filter of the source. Can be \"OBS_SCALE_DISABLE\", \"OBS_SCALE_POINT\", \"OBS_SCALE_BICUBIC\", \"OBS_SCALE_BILINEAR\", \"OBS_SCALE_LANCZOS\" or \"OBS_SCALE_AREA\"."
},
{
"type": "int",
"name": "crop.top",
@ -9092,7 +8780,6 @@
"{double (optional)} `rotation` The new clockwise rotation of the item in degrees.",
"{double (optional)} `scale.x` The new x scale of the item.",
"{double (optional)} `scale.y` The new y scale of the item.",
"{String (optional)} `scale.filter` The new scale filter of the source. Can be \"OBS_SCALE_DISABLE\", \"OBS_SCALE_POINT\", \"OBS_SCALE_BICUBIC\", \"OBS_SCALE_BILINEAR\", \"OBS_SCALE_LANCZOS\" or \"OBS_SCALE_AREA\".",
"{int (optional)} `crop.top` The new amount of pixels cropped off the top of the source before scaling.",
"{int (optional)} `crop.bottom` The new amount of pixels cropped off the bottom of the source before scaling.",
"{int (optional)} `crop.left` The new amount of pixels cropped off the left of the source before scaling.",
@ -9159,11 +8846,6 @@
"name": "scale.y",
"description": "The new y scale of the item."
},
{
"type": "String (optional)",
"name": "scale.filter",
"description": "The new scale filter of the source. Can be \"OBS_SCALE_DISABLE\", \"OBS_SCALE_POINT\", \"OBS_SCALE_BICUBIC\", \"OBS_SCALE_BILINEAR\", \"OBS_SCALE_LANCZOS\" or \"OBS_SCALE_AREA\"."
},
{
"type": "int (optional)",
"name": "crop.top",
@ -9652,7 +9334,7 @@
"param": [
"{String} `sceneName` Name of the scene to create the scene item in",
"{String} `sourceName` Name of the source to be added",
"{boolean (optional)} `setVisible` Whether to make the sceneitem visible on creation or not. Default `true`"
"{boolean} `setVisible` Whether to make the sceneitem visible on creation or not. Default `true`"
],
"return": "{int} `itemId` Numerical ID of the created scene item",
"api": "requests",
@ -9678,7 +9360,7 @@
"description": "Name of the source to be added"
},
{
"type": "boolean (optional)",
"type": "boolean",
"name": "setVisible",
"description": "Whether to make the sceneitem visible on creation or not. Default `true`"
}
@ -9991,7 +9673,7 @@
"description": "Changes the order of scene items in the requested scene.",
"param": [
"{String (optional)} `scene` Name of the scene to reorder (defaults to current).",
"{Array<Object>} `items` Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene",
"{Array<Scene>} `items` Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene",
"{int (optional)} `items.*.id` Id of a specific scene item. Unique on a scene by scene basis.",
"{String (optional)} `items.*.name` Name of a scene item. Sufficiently unique if no scene items share sources within the scene."
],
@ -10006,7 +9688,7 @@
"description": "Name of the scene to reorder (defaults to current)."
},
{
"type": "Array<Object>",
"type": "Array<Scene>",
"name": "items",
"description": "Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene"
},
@ -10209,11 +9891,9 @@
"{boolean} `streaming` Current streaming status.",
"{boolean} `recording` Current recording status.",
"{boolean} `recording-paused` If recording is paused.",
"{boolean} `virtualcam` Current virtual cam status.",
"{boolean} `preview-only` Always false. Retrocompatibility with OBSRemote.",
"{String (optional)} `stream-timecode` Time elapsed since streaming started (only present if currently streaming).",
"{String (optional)} `rec-timecode` Time elapsed since recording started (only present if currently recording).",
"{String (optional)} `virtualcam-timecode` Time elapsed since virtual cam started (only present if virtual cam currently active)."
"{String (optional)} `rec-timecode` Time elapsed since recording started (only present if currently recording)."
],
"api": "requests",
"name": "GetStreamingStatus",
@ -10235,11 +9915,6 @@
"name": "recording-paused",
"description": "If recording is paused."
},
{
"type": "boolean",
"name": "virtualcam",
"description": "Current virtual cam status."
},
{
"type": "boolean",
"name": "preview-only",
@ -10254,11 +9929,6 @@
"type": "String (optional)",
"name": "rec-timecode",
"description": "Time elapsed since recording started (only present if currently recording)."
},
{
"type": "String (optional)",
"name": "virtualcam-timecode",
"description": "Time elapsed since virtual cam started (only present if virtual cam currently active)."
}
],
"names": [
@ -11427,156 +11097,6 @@
"type": "class",
"examples": []
}
],
"virtual cam": [
{
"subheads": [],
"description": "Get current virtual cam status.",
"return": [
"{boolean} `isVirtualCam` Current virtual camera status.",
"{String (optional)} `virtualCamTimecode` Time elapsed since virtual cam started (only present if virtual cam currently active)."
],
"api": "requests",
"name": "GetVirtualCamStatus",
"category": "virtual cam",
"since": "4.9.1",
"returns": [
{
"type": "boolean",
"name": "isVirtualCam",
"description": "Current virtual camera status."
},
{
"type": "String (optional)",
"name": "virtualCamTimecode",
"description": "Time elapsed since virtual cam started (only present if virtual cam currently active)."
}
],
"names": [
{
"name": "",
"description": "GetVirtualCamStatus"
}
],
"categories": [
{
"name": "",
"description": "virtual cam"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "GetVirtualCamStatus"
},
"lead": "",
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Toggle virtual cam on or off (depending on the current virtual cam state).",
"api": "requests",
"name": "StartStopVirtualCam",
"category": "virtual cam",
"since": "4.9.1",
"names": [
{
"name": "",
"description": "StartStopVirtualCam"
}
],
"categories": [
{
"name": "",
"description": "virtual cam"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "StartStopVirtualCam"
},
"lead": "",
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Start virtual cam.\nWill return an `error` if virtual cam is already active.",
"api": "requests",
"name": "StartVirtualCam",
"category": "virtual cam",
"since": "4.9.1",
"names": [
{
"name": "",
"description": "StartVirtualCam"
}
],
"categories": [
{
"name": "",
"description": "virtual cam"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "StartVirtualCam"
},
"lead": "",
"type": "class",
"examples": []
},
{
"subheads": [],
"description": "Stop virtual cam.\nWill return an `error` if virtual cam is not active.",
"api": "requests",
"name": "StopVirtualCam",
"category": "virtual cam",
"since": "4.9.1",
"names": [
{
"name": "",
"description": "StopVirtualCam"
}
],
"categories": [
{
"name": "",
"description": "virtual cam"
}
],
"sinces": [
{
"name": "",
"description": "4.9.1"
}
],
"heading": {
"level": 2,
"text": "StopVirtualCam"
},
"lead": "",
"type": "class",
"examples": []
}
]
}
}

View File

@ -1,6 +1,6 @@
<!-- This file was generated based on handlebars templates. Do not edit directly! -->
# obs-websocket 4.9.1 protocol reference
# obs-websocket 4.9.0 protocol reference
# General Introduction
Messages are exchanged between the client and the server as JSON objects.
@ -37,7 +37,7 @@ auth_response_hash = binary_sha256(auth_response_string)
auth_response = base64_encode(auth_response_hash)
```
You can also refer to any of the [client libraries](https://github.com/Palakis/obs-websocket#for-developers) listed on the README for examples of how to authenticate.
You can also refer to any of the client libraries listed on the [README](README.md) for examples of how to authenticate.
@ -82,9 +82,6 @@ You can also refer to any of the [client libraries](https://github.com/Palakis/o
+ [RecordingStopped](#recordingstopped)
+ [RecordingPaused](#recordingpaused)
+ [RecordingResumed](#recordingresumed)
* [Virtual Cam](#virtual-cam)
+ [VirtualCamStarted](#virtualcamstarted)
+ [VirtualCamStopped](#virtualcamstopped)
* [Replay Buffer](#replay-buffer)
+ [ReplayStarting](#replaystarting)
+ [ReplayStarted](#replaystarted)
@ -145,7 +142,6 @@ You can also refer to any of the [client libraries](https://github.com/Palakis/o
+ [TriggerHotkeyByName](#triggerhotkeybyname)
+ [TriggerHotkeyBySequence](#triggerhotkeybysequence)
+ [ExecuteBatch](#executebatch)
+ [Sleep](#sleep)
* [Media Control](#media-control)
+ [PlayPauseMedia](#playpausemedia)
+ [RestartMedia](#restartmedia)
@ -164,12 +160,9 @@ You can also refer to any of the [client libraries](https://github.com/Palakis/o
+ [GetSourceTypesList](#getsourcetypeslist)
+ [GetVolume](#getvolume)
+ [SetVolume](#setvolume)
+ [SetAudioTracks](#setaudiotracks)
+ [GetAudioTracks](#getaudiotracks)
+ [GetMute](#getmute)
+ [SetMute](#setmute)
+ [ToggleMute](#togglemute)
+ [GetSourceActive](#getsourceactive)
+ [GetAudioActive](#getaudioactive)
+ [SetSourceName](#setsourcename)
+ [SetSyncOffset](#setsyncoffset)
@ -273,11 +266,6 @@ You can also refer to any of the [client libraries](https://github.com/Palakis/o
+ [SetTransitionSettings](#settransitionsettings)
+ [ReleaseTBar](#releasetbar)
+ [SetTBarPosition](#settbarposition)
* [Virtual Cam](#virtual-cam-1)
+ [GetVirtualCamStatus](#getvirtualcamstatus)
+ [StartStopVirtualCam](#startstopvirtualcam)
+ [StartVirtualCam](#startvirtualcam)
+ [StopVirtualCam](#stopvirtualcam)
<!-- tocstop -->
@ -313,7 +301,6 @@ These are complex types, such as `Source` and `Scene`, which are used as argumen
| `rotation` | _double_ | The clockwise rotation of the scene item in degrees around the point of alignment. |
| `scale.x` | _double_ | The x-scale factor of the scene item. |
| `scale.y` | _double_ | The y-scale factor of the scene item. |
| `scale.filter` | _String_ | The scale filter of the source. Can be "OBS_SCALE_DISABLE", "OBS_SCALE_POINT", "OBS_SCALE_BICUBIC", "OBS_SCALE_BILINEAR", "OBS_SCALE_LANCZOS" or "OBS_SCALE_AREA". |
| `crop.top` | _int_ | The number of pixels cropped off the top of the scene item before scaling. |
| `crop.right` | _int_ | The number of pixels cropped off the right of the scene item before scaling. |
| `crop.bottom` | _int_ | The number of pixels cropped off the bottom of the scene item before scaling. |
@ -356,7 +343,7 @@ These are complex types, such as `Source` and `Scene`, which are used as argumen
| `flags.encoded` | _boolean_ | Output is encoded |
| `flags.multiTrack` | _boolean_ | Output uses several audio tracks |
| `flags.service` | _boolean_ | Output uses a service |
| `settings` | _Object_ | Output settings |
| `settings` | _Object_ | Output name |
| `active` | _boolean_ | Output status (active or not) |
| `reconnecting` | _boolean_ | Output reconnection status (reconnecting or not) |
| `congestion` | _double_ | Output congestion |
@ -524,7 +511,7 @@ A transition (other than "cut") has begun.
| `name` | _String_ | Transition name. |
| `type` | _String_ | Transition type. |
| `duration` | _int_ | Transition duration (in milliseconds). Will be -1 for any transition with a fixed duration, such as a Stinger, due to limitations of the OBS API. |
| `from-scene` | _String (optional)_ | Source scene of the transition |
| `from-scene` | _String_ | Source scene of the transition |
| `to-scene` | _String_ | Destination scene of the transition |
@ -564,7 +551,7 @@ A stinger transition has finished playing its video.
| `name` | _String_ | Transition name. |
| `type` | _String_ | Transition type. |
| `duration` | _int_ | Transition duration (in milliseconds). |
| `from-scene` | _String (optional)_ | Source scene of the transition |
| `from-scene` | _String_ | Source scene of the transition |
| `to-scene` | _String_ | Destination scene of the transition |
@ -791,34 +778,6 @@ _No additional response items._
---
## Virtual Cam
### VirtualCamStarted
- Added in v4.9.1
Virtual cam started successfully.
**Response Items:**
_No additional response items._
---
### VirtualCamStopped
- Added in v4.9.1
Virtual cam stopped successfully.
**Response Items:**
_No additional response items._
---
## Replay Buffer
### ReplayStarting
@ -986,7 +945,6 @@ The volume of a source has changed.
| ---- | :---: | ------------|
| `sourceName` | _String_ | Source name |
| `volume` | _float_ | Source volume |
| `volumeDb` | _float_ | Source volume in Decibel |
---
@ -1819,26 +1777,6 @@ Executes a list of requests sequentially (one-by-one on the same thread).
| `results.*.error` | _String (Optional)_ | Error message accompanying an `error` status. |
---
### Sleep
- Added in v4.9.1
Waits for the specified duration. Designed to be used in `ExecuteBatch` operations.
**Request Fields:**
| Name | Type | Description |
| ---- | :---: | ------------|
| `sleepMillis` | _int_ | Delay in milliseconds to wait before continuing. |
**Response Items:**
_No additional response items._
---
## Media Control
@ -1849,14 +1787,13 @@ _No additional response items._
- Added in v4.9.0
Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)
Note :Leaving out `playPause` toggles the current pause state
**Request Fields:**
| Name | Type | Description |
| ---- | :---: | ------------|
| `sourceName` | _String_ | Source name. |
| `playPause` | _boolean_ | (optional) Whether to pause or play the source. `false` for play, `true` for pause. |
| `playPause` | _boolean_ | Whether to pause or play the source. `false` for play, `true` for pause. |
**Response Items:**
@ -2211,56 +2148,6 @@ Set the volume of the specified source. Default request format uses mul, NOT SLI
_No additional response items._
---
### SetAudioTracks
- Added in v4.9.1
Changes whether an audio track is active for a source.
**Request Fields:**
| Name | Type | Description |
| ---- | :---: | ------------|
| `sourceName` | _String_ | Source name. |
| `track` | _int_ | Audio tracks 1-6. |
| `active` | _boolean_ | Whether audio track is active or not. |
**Response Items:**
_No additional response items._
---
### GetAudioTracks
- Added in v4.9.1
Gets whether an audio track is active for a source.
**Request Fields:**
| Name | Type | Description |
| ---- | :---: | ------------|
| `sourceName` | _String_ | Source name. |
**Response Items:**
| Name | Type | Description |
| ---- | :---: | ------------|
| `track1` | _boolean_ | |
| `track2` | _boolean_ | |
| `track3` | _boolean_ | |
| `track4` | _boolean_ | |
| `track5` | _boolean_ | |
| `track6` | _boolean_ | |
---
### GetMute
@ -2326,29 +2213,6 @@ Inverts the mute status of a specified source.
_No additional response items._
---
### GetSourceActive
- Added in v4.9.1
Get the source's active status of a specified source (if it is showing in the final mix).
**Request Fields:**
| Name | Type | Description |
| ---- | :---: | ------------|
| `sourceName` | _String_ | Source name. |
**Response Items:**
| Name | Type | Description |
| ---- | :---: | ------------|
| `sourceActive` | _boolean_ | Source active status of the source. |
---
### GetAudioActive
@ -3592,7 +3456,6 @@ Coordinates are relative to the item's parent (the scene or group it belongs to)
| `rotation` | _double_ | The clockwise rotation of the item in degrees around the point of alignment. |
| `scale.x` | _double_ | The x-scale factor of the source. |
| `scale.y` | _double_ | The y-scale factor of the source. |
| `scale.filter` | _String_ | The scale filter of the source. Can be "OBS_SCALE_DISABLE", "OBS_SCALE_POINT", "OBS_SCALE_BICUBIC", "OBS_SCALE_BILINEAR", "OBS_SCALE_LANCZOS" or "OBS_SCALE_AREA". |
| `crop.top` | _int_ | The number of pixels cropped off the top of the source before scaling. |
| `crop.right` | _int_ | The number of pixels cropped off the right of the source before scaling. |
| `crop.bottom` | _int_ | The number of pixels cropped off the bottom of the source before scaling. |
@ -3636,7 +3499,6 @@ Coordinates are relative to the item's parent (the scene or group it belongs to)
| `rotation` | _double (optional)_ | The new clockwise rotation of the item in degrees. |
| `scale.x` | _double (optional)_ | The new x scale of the item. |
| `scale.y` | _double (optional)_ | The new y scale of the item. |
| `scale.filter` | _String (optional)_ | The new scale filter of the source. Can be "OBS_SCALE_DISABLE", "OBS_SCALE_POINT", "OBS_SCALE_BICUBIC", "OBS_SCALE_BILINEAR", "OBS_SCALE_LANCZOS" or "OBS_SCALE_AREA". |
| `crop.top` | _int (optional)_ | The new amount of pixels cropped off the top of the source before scaling. |
| `crop.bottom` | _int (optional)_ | The new amount of pixels cropped off the bottom of the source before scaling. |
| `crop.left` | _int (optional)_ | The new amount of pixels cropped off the left of the source before scaling. |
@ -3812,7 +3674,7 @@ Creates a scene item in a scene. In other words, this is how you add a source in
| ---- | :---: | ------------|
| `sceneName` | _String_ | Name of the scene to create the scene item in |
| `sourceName` | _String_ | Name of the source to be added |
| `setVisible` | _boolean (optional)_ | Whether to make the sceneitem visible on creation or not. Default `true` |
| `setVisible` | _boolean_ | Whether to make the sceneitem visible on creation or not. Default `true` |
**Response Items:**
@ -3950,7 +3812,7 @@ Changes the order of scene items in the requested scene.
| Name | Type | Description |
| ---- | :---: | ------------|
| `scene` | _String (optional)_ | Name of the scene to reorder (defaults to current). |
| `items` | _Array&lt;Object&gt;_ | Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene |
| `items` | _Array&lt;Scene&gt;_ | Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene |
| `items.*.id` | _int (optional)_ | Id of a specific scene item. Unique on a scene by scene basis. |
| `items.*.name` | _String (optional)_ | Name of a scene item. Sufficiently unique if no scene items share sources within the scene. |
@ -4047,11 +3909,9 @@ _No specified parameters._
| `streaming` | _boolean_ | Current streaming status. |
| `recording` | _boolean_ | Current recording status. |
| `recording-paused` | _boolean_ | If recording is paused. |
| `virtualcam` | _boolean_ | Current virtual cam status. |
| `preview-only` | _boolean_ | Always false. Retrocompatibility with OBSRemote. |
| `stream-timecode` | _String (optional)_ | Time elapsed since streaming started (only present if currently streaming). |
| `rec-timecode` | _String (optional)_ | Time elapsed since recording started (only present if currently recording). |
| `virtualcam-timecode` | _String (optional)_ | Time elapsed since virtual cam started (only present if virtual cam currently active). |
---
@ -4562,79 +4422,3 @@ _No additional response items._
---
## Virtual Cam
### GetVirtualCamStatus
- Added in v4.9.1
Get current virtual cam status.
**Request Fields:**
_No specified parameters._
**Response Items:**
| Name | Type | Description |
| ---- | :---: | ------------|
| `isVirtualCam` | _boolean_ | Current virtual camera status. |
| `virtualCamTimecode` | _String (optional)_ | Time elapsed since virtual cam started (only present if virtual cam currently active). |
---
### StartStopVirtualCam
- Added in v4.9.1
Toggle virtual cam on or off (depending on the current virtual cam state).
**Request Fields:**
_No specified parameters._
**Response Items:**
_No additional response items._
---
### StartVirtualCam
- Added in v4.9.1
Start virtual cam.
Will return an `error` if virtual cam is already active.
**Request Fields:**
_No specified parameters._
**Response Items:**
_No additional response items._
---
### StopVirtualCam
- Added in v4.9.1
Stop virtual cam.
Will return an `error` if virtual cam is not active.
**Request Fields:**
_No specified parameters._
**Response Items:**
_No additional response items._
---

View File

@ -1,4 +1,4 @@
# obs-websocket 4.9.1 protocol reference
# obs-websocket 4.9.0 protocol reference
# General Introduction
Messages are exchanged between the client and the server as JSON objects.
@ -35,4 +35,4 @@ auth_response_hash = binary_sha256(auth_response_string)
auth_response = base64_encode(auth_response_hash)
```
You can also refer to any of the [client libraries](https://github.com/Palakis/obs-websocket#for-developers) listed on the README for examples of how to authenticate.
You can also refer to any of the client libraries listed on the [README](README.md) for examples of how to authenticate.

View File

@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "obs-websocket"
#define MyAppVersion "4.9.1-compat"
#define MyAppVersion "4.9.0"
#define MyAppPublisher "Stephane Lepin"
#define MyAppURL "http://github.com/Palakis/obs-websocket"

View File

@ -274,9 +274,9 @@ void Config::OnFrontendEvent(enum obs_frontend_event event, void* param)
if (event == OBS_FRONTEND_EVENT_PROFILE_CHANGED) {
obs_frontend_push_ui_translation(obs_module_get_string);
QString startMessage = QObject::tr("OBSWebsocketCompat.ProfileChanged.Started");
QString stopMessage = QObject::tr("OBSWebsocketCompat.ProfileChanged.Stopped");
QString restartMessage = QObject::tr("OBSWebsocketCompat.ProfileChanged.Restarted");
QString startMessage = QObject::tr("OBSWebsocket.ProfileChanged.Started");
QString stopMessage = QObject::tr("OBSWebsocket.ProfileChanged.Stopped");
QString restartMessage = QObject::tr("OBSWebsocket.ProfileChanged.Restarted");
obs_frontend_pop_ui_translation();
bool previousEnabled = config->ServerEnabled;
@ -323,18 +323,14 @@ void Config::FirstRunPasswordSetup()
// check if the password is already set
auto config = GetConfig();
if (!config) {
return;
}
if (!(config->Secret.isEmpty()) && !(config->Salt.isEmpty())) {
return;
}
obs_frontend_push_ui_translation(obs_module_get_string);
QString dialogTitle = QObject::tr("OBSWebsocketCompat.InitialPasswordSetup.Title");
QString dialogText = QObject::tr("OBSWebsocketCompat.InitialPasswordSetup.Text");
QString dismissedText = QObject::tr("OBSWebsocketCompat.InitialPasswordSetup.DismissedText");
QString dialogTitle = QObject::tr("OBSWebsocket.InitialPasswordSetup.Title");
QString dialogText = QObject::tr("OBSWebsocket.InitialPasswordSetup.Text");
QString dismissedText = QObject::tr("OBSWebsocket.InitialPasswordSetup.DismissedText");
obs_frontend_pop_ui_translation();
auto mainWindow = reinterpret_cast<QMainWindow*>(

View File

@ -52,24 +52,6 @@ obs_bounds_type getBoundsTypeFromName(QString name) {
return boundTypeNames.key(name);
}
const QHash<obs_scale_type, QString> scaleTypeNames = {
{ OBS_SCALE_DISABLE, "OBS_SCALE_DISABLE" },
{ OBS_SCALE_POINT, "OBS_SCALE_POINT" },
{ OBS_SCALE_BICUBIC, "OBS_SCALE_BICUBIC" },
{ OBS_SCALE_BILINEAR, "OBS_SCALE_BILINEAR" },
{ OBS_SCALE_LANCZOS, "OBS_SCALE_LANCZOS" },
{ OBS_SCALE_AREA, "OBS_SCALE_AREA" },
};
QString getScaleNameFromType(obs_scale_type type) {
QString fallback = scaleTypeNames.value(OBS_SCALE_DISABLE);
return scaleTypeNames.value(type, fallback);
}
obs_scale_type getFilterTypeFromName(QString name) {
return scaleTypeNames.key(name);
}
bool Utils::StringInStringList(char** strings, const char* string) {
if (!strings) {
return false;
@ -378,7 +360,8 @@ obs_source_t* Utils::GetTransitionFromName(QString searchName) {
QString transitionName = obs_source_get_name(transition);
if (transitionName == searchName) {
foundTransition = obs_source_get_ref(transition);
foundTransition = transition;
obs_source_addref(foundTransition);
break;
}
}
@ -526,9 +509,9 @@ QSystemTrayIcon* Utils::GetTrayIcon() {
return reinterpret_cast<QSystemTrayIcon*>(systemTray);
}
void Utils::SysTrayNotify(QString text, QSystemTrayIcon::MessageIcon icon, QString title) {
auto config = GetConfig();
if ((config && !config->AlertsEnabled) ||
void Utils::SysTrayNotify(QString text,
QSystemTrayIcon::MessageIcon icon, QString title) {
if (!GetConfig()->AlertsEnabled ||
!QSystemTrayIcon::isSystemTrayAvailable() ||
!QSystemTrayIcon::supportsMessages())
{
@ -747,7 +730,6 @@ const char* Utils::GetCurrentRecordingFilename()
* @property {double} `rotation` The clockwise rotation of the scene item in degrees around the point of alignment.
* @property {double} `scale.x` The x-scale factor of the scene item.
* @property {double} `scale.y` The y-scale factor of the scene item.
* @property {String} `scale.filter` The scale filter of the source. Can be "OBS_SCALE_DISABLE", "OBS_SCALE_POINT", "OBS_SCALE_BICUBIC", "OBS_SCALE_BILINEAR", "OBS_SCALE_LANCZOS" or "OBS_SCALE_AREA".
* @property {int} `crop.top` The number of pixels cropped off the top of the scene item before scaling.
* @property {int} `crop.right` The number of pixels cropped off the right of the scene item before scaling.
* @property {int} `crop.bottom` The number of pixels cropped off the bottom of the scene item before scaling.
@ -791,16 +773,12 @@ obs_data_t* Utils::GetSceneItemPropertiesData(obs_sceneitem_t* sceneItem) {
uint32_t boundsAlignment = obs_sceneitem_get_bounds_alignment(sceneItem);
QString boundsTypeName = getBoundsNameFromType(boundsType);
obs_scale_type scaleFilter = obs_sceneitem_get_scale_filter(sceneItem);
QString scaleFilterName = getScaleNameFromType(scaleFilter);
OBSDataAutoRelease posData = obs_data_create();
obs_data_set_double(posData, "x", pos.x);
obs_data_set_double(posData, "y", pos.y);
obs_data_set_int(posData, "alignment", alignment);
OBSDataAutoRelease scaleData = obs_data_create();
obs_data_set_string(scaleData, "filter", scaleFilterName.toUtf8());
obs_data_set_double(scaleData, "x", scale.x);
obs_data_set_double(scaleData, "y", scale.y);

View File

@ -124,7 +124,7 @@ void WSEvents::FrontendEventHandler(enum obs_frontend_event event, void* private
case OBS_FRONTEND_EVENT_FINISHED_LOADING:
owner->hookTransitionPlaybackEvents();
break;
case OBS_FRONTEND_EVENT_SCENE_CHANGED:
owner->OnSceneChange();
break;
@ -202,14 +202,6 @@ void WSEvents::FrontendEventHandler(enum obs_frontend_event event, void* private
owner->OnRecordingResumed();
break;
case OBS_FRONTEND_EVENT_VIRTUALCAM_STARTED:
owner->OnVirtualCamStarted();
break;
case OBS_FRONTEND_EVENT_VIRTUALCAM_STOPPED:
owner->OnVirtualCamStopped();
break;
case OBS_FRONTEND_EVENT_REPLAY_BUFFER_STARTING:
owner->OnReplayStarting();
break;
@ -249,17 +241,14 @@ void WSEvents::FrontendEventHandler(enum obs_frontend_event event, void* private
void WSEvents::broadcastUpdate(const char* updateType,
obs_data_t* additionalFields = nullptr)
{
if (!_srv->isListening()) {
return;
}
uint64_t streamTime = 0;
std::optional<uint64_t> streamTime;
if (obs_frontend_streaming_active()) {
streamTime = getStreamingTime();
streamTime = std::make_optional(getStreamingTime());
}
uint64_t recordingTime;
std::optional<uint64_t> recordingTime;
if (obs_frontend_recording_active()) {
recordingTime = getRecordingTime();
recordingTime = std::make_optional(getRecordingTime());
}
RpcEvent event(QString(updateType), streamTime, recordingTime, additionalFields);
@ -289,7 +278,7 @@ void WSEvents::connectSourceSignals(obs_source_t* source) {
signal_handler_connect(sh, "filter_add", OnSourceFilterAdded, this);
signal_handler_connect(sh, "filter_remove", OnSourceFilterRemoved, this);
signal_handler_connect(sh, "reorder_filters", OnSourceFilterOrderChanged, this);
signal_handler_connect(sh, "media_play", OnMediaPlaying, this);
signal_handler_connect(sh, "media_pause", OnMediaPaused, this);
signal_handler_connect(sh, "media_restart", OnMediaRestarted, this);
@ -347,7 +336,7 @@ void WSEvents::disconnectSourceSignals(obs_source_t* source) {
signal_handler_disconnect(sh, "transition_start", OnTransitionBegin, this);
signal_handler_disconnect(sh, "transition_stop", OnTransitionEnd, this);
signal_handler_disconnect(sh, "transition_video_stop", OnTransitionVideoEnd, this);
signal_handler_disconnect(sh, "media_play", OnMediaPlaying, this);
signal_handler_disconnect(sh, "media_pause", OnMediaPaused, this);
signal_handler_disconnect(sh, "media_restart", OnMediaRestarted, this);
@ -433,11 +422,6 @@ uint64_t WSEvents::getRecordingTime() {
return getOutputRunningTime(recordingOutput);
}
uint64_t WSEvents::getVirtualCamTime() {
OBSOutputAutoRelease virtualCamOutput = obs_frontend_get_virtualcam_output();
return getOutputRunningTime(virtualCamOutput);
}
QString WSEvents::getStreamingTimecode() {
return Utils::nsToTimestamp(getStreamingTime());
}
@ -446,10 +430,6 @@ QString WSEvents::getRecordingTimecode() {
return Utils::nsToTimestamp(getRecordingTime());
}
QString WSEvents::getVirtualCamTimecode() {
return Utils::nsToTimestamp(getVirtualCamTime());
}
OBSDataAutoRelease getMediaSourceData(calldata_t* data) {
OBSDataAutoRelease fields = obs_data_create();
OBSSource source = calldata_get_pointer<obs_source_t>(data, "source");
@ -489,7 +469,7 @@ void WSEvents::OnSceneChange() {
* Note: This event is not fired when the scenes are reordered.
*
* @return {Array<Scene>} `scenes` Scenes list.
*
*
* @api events
* @name ScenesChanged
* @category scenes
@ -507,7 +487,7 @@ void WSEvents::OnSceneListChange() {
* Triggered when switching to another scene collection or when renaming the current scene collection.
*
* @return {String} `sceneCollection` Name of the new current scene collection.
*
*
* @api events
* @name SceneCollectionChanged
* @category scenes
@ -530,7 +510,7 @@ void WSEvents::OnSceneCollectionChange() {
*
* @return {Array<Object>} `sceneCollections` Scene collections list.
* @return {String} `sceneCollections.*.name` Scene collection name.
*
*
* @api events
* @name SceneCollectionListChanged
* @category scenes
@ -573,7 +553,7 @@ void WSEvents::OnTransitionChange() {
*
* @return {Array<Object>} `transitions` Transitions list.
* @return {String} `transitions.*.name` Transition name.
*
*
* @api events
* @name TransitionListChanged
* @category transitions
@ -602,7 +582,7 @@ void WSEvents::OnTransitionListChange() {
* Triggered when switching to another profile or when renaming the current profile.
*
* @return {String} `profile` Name of the new current profile.
*
*
* @api events
* @name ProfileChanged
* @category profiles
@ -610,10 +590,8 @@ void WSEvents::OnTransitionListChange() {
*/
void WSEvents::OnProfileChange() {
OBSDataAutoRelease fields = obs_data_create();
char *profile = obs_frontend_get_current_profile();
obs_data_set_string(fields, "profile", profile);
obs_data_set_string(fields, "profile", obs_frontend_get_current_profile());
broadcastUpdate("ProfileChanged", fields);
bfree(profile);
}
/**
@ -621,7 +599,7 @@ void WSEvents::OnProfileChange() {
*
* @return {Array<Object>} `profiles` Profiles list.
* @return {String} `profiles.*.name` Profile name.
*
*
* @api events
* @name ProfileListChanged
* @category profiles
@ -701,10 +679,10 @@ void WSEvents::OnStreamStopped() {
/**
* A request to start recording has been issued.
*
*
* Note: `recordingFilename` is not provided in this event because this information
* is not available at the time this event is emitted.
*
*
* @api events
* @name RecordingStarting
* @category recording
@ -718,7 +696,7 @@ void WSEvents::OnRecordingStarting() {
* Recording started successfully.
*
* @return {String} `recordingFilename` Absolute path to the file of the current recording.
*
*
* @api events
* @name RecordingStarted
* @category recording
@ -734,7 +712,7 @@ void WSEvents::OnRecordingStarted() {
* A request to stop recording has been issued.
*
* @return {String} `recordingFilename` Absolute path to the file of the current recording.
*
*
* @api events
* @name RecordingStopping
* @category recording
@ -750,7 +728,7 @@ void WSEvents::OnRecordingStopping() {
* Recording stopped successfully.
*
* @return {String} `recordingFilename` Absolute path to the file of the current recording.
*
*
* @api events
* @name RecordingStopped
* @category recording
@ -786,30 +764,6 @@ void WSEvents::OnRecordingResumed() {
broadcastUpdate("RecordingResumed");
}
/**
* Virtual cam started successfully.
*
* @api events
* @name VirtualCamStarted
* @category virtual cam
* @since 4.9.1
*/
void WSEvents::OnVirtualCamStarted() {
broadcastUpdate("VirtualCamStarted");
}
/**
* Virtual cam stopped successfully.
*
* @api events
* @name VirtualCamStopped
* @category virtual cam
* @since 4.9.1
*/
void WSEvents::OnVirtualCamStopped() {
broadcastUpdate("VirtualCamStopped");
}
/**
* A request to start the replay buffer has been issued.
*
@ -1045,10 +999,10 @@ void WSEvents::TransitionDurationChanged(int ms) {
*
* @return {String} `name` Transition name.
* @return {String} `type` Transition type.
* @return {int} `duration` Transition duration (in milliseconds).
* Will be -1 for any transition with a fixed duration,
* @return {int} `duration` Transition duration (in milliseconds).
* Will be -1 for any transition with a fixed duration,
* such as a Stinger, due to limitations of the OBS API.
* @return {String (optional)} `from-scene` Source scene of the transition
* @return {String} `from-scene` Source scene of the transition
* @return {String} `to-scene` Destination scene of the transition
*
* @api events
@ -1100,7 +1054,7 @@ void WSEvents::OnTransitionEnd(void* param, calldata_t* data) {
* @return {String} `name` Transition name.
* @return {String} `type` Transition type.
* @return {int} `duration` Transition duration (in milliseconds).
* @return {String (optional)} `from-scene` Source scene of the transition
* @return {String} `from-scene` Source scene of the transition
* @return {String} `to-scene` Destination scene of the transition
*
* @api events
@ -1191,7 +1145,6 @@ void WSEvents::OnSourceDestroy(void* param, calldata_t* data) {
*
* @return {String} `sourceName` Source name
* @return {float} `volume` Source volume
* @return {float} `volumeDb` Source volume in Decibel
*
* @api events
* @name SourceVolumeChanged
@ -1211,15 +1164,9 @@ void WSEvents::OnSourceVolumeChange(void* param, calldata_t* data) {
return;
}
double volumeDb = obs_mul_to_db(volume);
if (volumeDb == -INFINITY) {
volumeDb = -100.0;
}
OBSDataAutoRelease fields = obs_data_create();
obs_data_set_string(fields, "sourceName", obs_source_get_name(source));
obs_data_set_double(fields, "volume", volume);
obs_data_set_double(fields, "volumeDb", volumeDb);
self->broadcastUpdate("SourceVolumeChanged", fields);
}
@ -1433,7 +1380,7 @@ void WSEvents::OnSourceFilterAdded(void* param, calldata_t* data) {
if (!filter) {
return;
}
self->connectFilterSignals(filter);
OBSDataAutoRelease filterSettings = obs_source_get_settings(filter);

View File

@ -48,11 +48,9 @@ public:
uint64_t getStreamingTime();
uint64_t getRecordingTime();
uint64_t getVirtualCamTime();
QString getStreamingTimecode();
QString getRecordingTimecode();
QString getVirtualCamTimecode();
obs_data_t* GetStats();
@ -103,9 +101,6 @@ private:
void OnRecordingStopped();
void OnRecordingPaused();
void OnRecordingResumed();
void OnVirtualCamStarted();
void OnVirtualCamStopped();
void OnReplayStarting();
void OnReplayStarted();

View File

@ -43,7 +43,6 @@ const QHash<QString, RpcMethodHandler> WSRequestHandler::messageMap{
{ "TriggerHotkeyByName", &WSRequestHandler::TriggerHotkeyByName },
{ "TriggerHotkeyBySequence", &WSRequestHandler::TriggerHotkeyBySequence },
{ "ExecuteBatch", &WSRequestHandler::ExecuteBatch },
{ "Sleep", &WSRequestHandler::Sleep },
// Category: Media Control
{ "PlayPauseMedia", &WSRequestHandler::PlayPauseMedia },
@ -121,12 +120,9 @@ const QHash<QString, RpcMethodHandler> WSRequestHandler::messageMap{
{ "GetSourceTypesList", &WSRequestHandler::GetSourceTypesList },
{ "GetVolume", &WSRequestHandler::GetVolume },
{ "SetVolume", &WSRequestHandler::SetVolume },
{ "SetAudioTracks", &WSRequestHandler::SetAudioTracks },
{ "GetAudioTracks", &WSRequestHandler::GetAudioTracks },
{ "GetMute", &WSRequestHandler::GetMute },
{ "SetMute", &WSRequestHandler::SetMute },
{ "ToggleMute", &WSRequestHandler::ToggleMute },
{ "GetSourceActive", &WSRequestHandler::GetSourceActive },
{ "GetAudioActive", &WSRequestHandler::GetAudioActive },
{ "SetSourceName", &WSRequestHandler::SetSourceName },
{ "SetSyncOffset", &WSRequestHandler::SetSyncOffset },
@ -163,12 +159,6 @@ const QHash<QString, RpcMethodHandler> WSRequestHandler::messageMap{
{ "GetStreamSettings", &WSRequestHandler::GetStreamSettings },
{ "SaveStreamSettings", &WSRequestHandler::SaveStreamSettings },
{ "SendCaptions", &WSRequestHandler::SendCaptions },
// Category: VirtualCam
{ "GetVirtualCamStatus", &WSRequestHandler::GetVirtualCamStatus },
{ "StartStopVirtualCam", &WSRequestHandler::StartStopVirtualCam },
{ "StartVirtualCam", &WSRequestHandler::StartVirtualCam },
{ "StopVirtualCam", &WSRequestHandler::StopVirtualCam },
// Category: Studio Mode
{ "GetStudioModeStatus", &WSRequestHandler::GetStudioModeStatus },
@ -204,8 +194,7 @@ WSRequestHandler::WSRequestHandler(ConnectionProperties& connProperties) :
}
RpcResponse WSRequestHandler::processRequest(const RpcRequest& request) {
auto config = GetConfig();
if ((config && config->AuthRequired)
if (GetConfig()->AuthRequired
&& (!authNotRequired.contains(request.methodName()))
&& (!_connProperties.isAuthenticated()))
{

View File

@ -61,7 +61,6 @@ class WSRequestHandler {
RpcResponse TriggerHotkeyByName(const RpcRequest&);
RpcResponse TriggerHotkeyBySequence(const RpcRequest&);
RpcResponse ExecuteBatch(const RpcRequest&);
RpcResponse Sleep(const RpcRequest&);
// Category: Media Control
RpcResponse PlayPauseMedia(const RpcRequest&);
@ -138,12 +137,9 @@ class WSRequestHandler {
RpcResponse GetSourceTypesList(const RpcRequest&);
RpcResponse GetVolume(const RpcRequest&);
RpcResponse SetVolume(const RpcRequest&);
RpcResponse SetAudioTracks(const RpcRequest&);
RpcResponse GetAudioTracks(const RpcRequest&);
RpcResponse GetMute(const RpcRequest&);
RpcResponse SetMute(const RpcRequest&);
RpcResponse ToggleMute(const RpcRequest&);
RpcResponse GetSourceActive(const RpcRequest&);
RpcResponse GetAudioActive(const RpcRequest&);
RpcResponse SetSourceName(const RpcRequest&);
RpcResponse SetSyncOffset(const RpcRequest&);
@ -180,12 +176,6 @@ class WSRequestHandler {
RpcResponse GetStreamSettings(const RpcRequest&);
RpcResponse SaveStreamSettings(const RpcRequest&);
RpcResponse SendCaptions(const RpcRequest&);
// Category: Virtual Cam
RpcResponse GetVirtualCamStatus(const RpcRequest&);
RpcResponse StartStopVirtualCam(const RpcRequest&);
RpcResponse StartVirtualCam(const RpcRequest&);
RpcResponse StopVirtualCam(const RpcRequest&);
// Category: Studio Mode
RpcResponse GetStudioModeStatus(const RpcRequest&);

View File

@ -115,13 +115,13 @@ RpcResponse WSRequestHandler::GetVersion(const RpcRequest& request) {
* @since 0.3
*/
RpcResponse WSRequestHandler::GetAuthRequired(const RpcRequest& request) {
auto config = GetConfig();
bool authRequired = (config && config->AuthRequired);
bool authRequired = GetConfig()->AuthRequired;
OBSDataAutoRelease data = obs_data_create();
obs_data_set_bool(data, "authRequired", authRequired);
if (authRequired) {
auto config = GetConfig();
obs_data_set_string(data, "challenge",
config->SessionChallenge.toUtf8());
obs_data_set_string(data, "salt",
@ -155,8 +155,7 @@ RpcResponse WSRequestHandler::Authenticate(const RpcRequest& request) {
return request.failed("auth not specified!");
}
auto config = GetConfig();
if (!config || (config->CheckAuth(auth) == false)) {
if (GetConfig()->CheckAuth(auth) == false) {
return request.failed("Authentication Failed.");
}
@ -474,24 +473,3 @@ RpcResponse WSRequestHandler::ExecuteBatch(const RpcRequest& request) {
obs_data_set_array(response, "results", results);
return request.success(response);
}
/**
* Waits for the specified duration. Designed to be used in `ExecuteBatch` operations.
*
* @param {int} `sleepMillis` Delay in milliseconds to wait before continuing.
*
* @api requests
* @name Sleep
* @category general
* @since 4.9.1
*/
RpcResponse WSRequestHandler::Sleep(const RpcRequest& request) {
if (!request.hasField("sleepMillis")) {
return request.failed("missing request parameters");
}
long long sleepMillis = obs_data_get_int(request.parameters(), "sleepMillis");
std::this_thread::sleep_for(std::chrono::milliseconds(sleepMillis));
return request.success();
}

View File

@ -44,10 +44,9 @@ QString getSourceMediaState(obs_source_t *source)
/**
* Pause or play a media source. Supports ffmpeg and vlc media sources (as of OBS v25.0.8)
* Note :Leaving out `playPause` toggles the current pause state
*
* @param {String} `sourceName` Source name.
* @param {boolean} `playPause` (optional) Whether to pause or play the source. `false` for play, `true` for pause.
* @param {boolean} `playPause` Whether to pause or play the source. `false` for play, `true` for pause.
*
* @api requests
* @name PlayPauseMedia
@ -55,7 +54,7 @@ QString getSourceMediaState(obs_source_t *source)
* @since 4.9.0
*/
RpcResponse WSRequestHandler::PlayPauseMedia(const RpcRequest& request) {
if (!request.hasField("sourceName")) {
if ((!request.hasField("sourceName")) || (!request.hasField("playPause"))) {
return request.failed("missing request parameters");
}
@ -69,16 +68,8 @@ RpcResponse WSRequestHandler::PlayPauseMedia(const RpcRequest& request) {
if (!source) {
return request.failed("specified source doesn't exist");
}
if (!request.hasField("playPause")) {
if (obs_source_media_get_state(source) == obs_media_state::OBS_MEDIA_STATE_PLAYING) {
obs_source_media_play_pause(source, true);
} else {
obs_source_media_play_pause(source, false);
}
} else {
bool playPause = obs_data_get_bool(request.parameters(), "playPause");
obs_source_media_play_pause(source, playPause);
}
obs_source_media_play_pause(source, playPause);
return request.success();
}

View File

@ -15,7 +15,7 @@
* @property {boolean} `flags.encoded` Output is encoded
* @property {boolean} `flags.multiTrack` Output uses several audio tracks
* @property {boolean} `flags.service` Output uses a service
* @property {Object} `settings` Output settings
* @property {Object} `settings` Output name
* @property {boolean} `active` Output status (active or not)
* @property {boolean} `reconnecting` Output reconnection status (reconnecting or not)
* @property {double} `congestion` Output congestion

View File

@ -6,6 +6,15 @@
#include "Utils.h"
#include "WSEvents.h"
RpcResponse ifCanPause(const RpcRequest& request, std::function<RpcResponse()> callback)
{
if (!obs_frontend_recording_active()) {
return request.failed("recording is not active");
}
return callback();
}
/**
* Get current recording status.
*
@ -94,14 +103,14 @@ RpcResponse WSRequestHandler::StartRecording(const RpcRequest& request) {
* @since 4.7.0
*/
RpcResponse WSRequestHandler::PauseRecording(const RpcRequest& request) {
if (!obs_frontend_recording_active())
return request.failed("recording is not active");
return ifCanPause(request, [request]() {
if (obs_frontend_recording_paused()) {
return request.failed("recording already paused");
}
if (obs_frontend_recording_paused())
return request.failed("recording already paused");
obs_frontend_recording_pause(true);
return request.success();
obs_frontend_recording_pause(true);
return request.success();
});
}
/**
@ -114,14 +123,14 @@ RpcResponse WSRequestHandler::PauseRecording(const RpcRequest& request) {
* @since 4.7.0
*/
RpcResponse WSRequestHandler::ResumeRecording(const RpcRequest& request) {
if (!obs_frontend_recording_active())
return request.failed("recording is not active");
return ifCanPause(request, [request]() {
if (!obs_frontend_recording_paused()) {
return request.failed("recording is not paused");
}
if (!obs_frontend_recording_paused())
return request.failed("recording is not paused");
obs_frontend_recording_pause(false);
return request.success();
obs_frontend_recording_pause(false);
return request.success();
});
}
/**

View File

@ -91,7 +91,6 @@ RpcResponse WSRequestHandler::GetSceneItemList(const RpcRequest& request) {
* @return {double} `rotation` The clockwise rotation of the item in degrees around the point of alignment.
* @return {double} `scale.x` The x-scale factor of the source.
* @return {double} `scale.y` The y-scale factor of the source.
* @return {String} `scale.filter` The scale filter of the source. Can be "OBS_SCALE_DISABLE", "OBS_SCALE_POINT", "OBS_SCALE_BICUBIC", "OBS_SCALE_BILINEAR", "OBS_SCALE_LANCZOS" or "OBS_SCALE_AREA".
* @return {int} `crop.top` The number of pixels cropped off the top of the source before scaling.
* @return {int} `crop.right` The number of pixels cropped off the right of the source before scaling.
* @return {int} `crop.bottom` The number of pixels cropped off the bottom of the source before scaling.
@ -157,7 +156,6 @@ RpcResponse WSRequestHandler::GetSceneItemProperties(const RpcRequest& request)
* @param {double (optional)} `rotation` The new clockwise rotation of the item in degrees.
* @param {double (optional)} `scale.x` The new x scale of the item.
* @param {double (optional)} `scale.y` The new y scale of the item.
* @param {String (optional)} `scale.filter` The new scale filter of the source. Can be "OBS_SCALE_DISABLE", "OBS_SCALE_POINT", "OBS_SCALE_BICUBIC", "OBS_SCALE_BILINEAR", "OBS_SCALE_LANCZOS" or "OBS_SCALE_AREA".
* @param {int (optional)} `crop.top` The new amount of pixels cropped off the top of the source before scaling.
* @param {int (optional)} `crop.bottom` The new amount of pixels cropped off the bottom of the source before scaling.
* @param {int (optional)} `crop.left` The new amount of pixels cropped off the left of the source before scaling.
@ -232,34 +230,12 @@ RpcResponse WSRequestHandler::SetSceneItemProperties(const RpcRequest& request)
}
if (request.hasField("scale")) {
OBSDataAutoRelease reqScale = obs_data_get_obj(params, "scale");
if (obs_data_has_user_value(reqScale, "filter")) {
QString newScaleFilter = obs_data_get_string(reqScale, "filter");
if (newScaleFilter == "OBS_SCALE_DISABLE") {
obs_sceneitem_set_scale_filter(sceneItem, OBS_SCALE_DISABLE);
}
else if (newScaleFilter == "OBS_SCALE_POINT") {
obs_sceneitem_set_scale_filter(sceneItem, OBS_SCALE_POINT);
}
else if (newScaleFilter == "OBS_SCALE_BICUBIC") {
obs_sceneitem_set_scale_filter(sceneItem, OBS_SCALE_BICUBIC);
}
else if (newScaleFilter == "OBS_SCALE_BILINEAR") {
obs_sceneitem_set_scale_filter(sceneItem, OBS_SCALE_BICUBIC);
}
else if (newScaleFilter == "OBS_SCALE_LANCZOS") {
obs_sceneitem_set_scale_filter(sceneItem, OBS_SCALE_LANCZOS);
}
else if (newScaleFilter == "OBS_SCALE_AREA") {
obs_sceneitem_set_scale_filter(sceneItem, OBS_SCALE_AREA);
}
}
vec2 oldScale;
obs_sceneitem_get_scale(sceneItem, &oldScale);
vec2 newScale = oldScale;
OBSDataAutoRelease reqScale = obs_data_get_obj(params, "scale");
if (obs_data_has_user_value(reqScale, "x")) {
newScale.x = obs_data_get_double(reqScale, "x");
}
@ -652,7 +628,7 @@ RpcResponse WSRequestHandler::DeleteSceneItem(const RpcRequest& request) {
*
* @param {String} `sceneName` Name of the scene to create the scene item in
* @param {String} `sourceName` Name of the source to be added
* @param {boolean (optional)} `setVisible` Whether to make the sceneitem visible on creation or not. Default `true`
* @param {boolean} `setVisible` Whether to make the sceneitem visible on creation or not. Default `true`
*
* @return {int} `itemId` Numerical ID of the created scene item
*

View File

@ -100,8 +100,7 @@ RpcResponse WSRequestHandler::CreateScene(const RpcRequest& request) {
if (source) {
return request.failed("scene with this name already exists");
}
obs_scene_t *createdScene = obs_scene_create(sceneName);
obs_scene_release(createdScene);
obs_scene_create(sceneName);
return request.success();
}
@ -109,7 +108,7 @@ RpcResponse WSRequestHandler::CreateScene(const RpcRequest& request) {
* Changes the order of scene items in the requested scene.
*
* @param {String (optional)} `scene` Name of the scene to reorder (defaults to current).
* @param {Array<Object>} `items` Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene
* @param {Array<Scene>} `items` Ordered list of objects with name and/or id specified. Id preferred due to uniqueness per scene
* @param {int (optional)} `items.*.id` Id of a specific scene item. Unique on a scene by scene basis.
* @param {String (optional)} `items.*.name` Name of a scene item. Sufficiently unique if no scene items share sources within the scene.
*
@ -204,8 +203,7 @@ RpcResponse WSRequestHandler::SetSceneTransitionOverride(const RpcRequest& reque
}
QString transitionName = obs_data_get_string(request.parameters(), "transitionName");
OBSSourceAutoRelease transition = Utils::GetTransitionFromName(transitionName);
if (!transition) {
if (!Utils::GetTransitionFromName(transitionName)) {
return request.failed("requested transition does not exist");
}

View File

@ -315,96 +315,6 @@ RpcResponse WSRequestHandler::SetVolume(const RpcRequest& request)
return request.success();
}
/**
* Changes whether an audio track is active for a source.
*
* @param {String} `sourceName` Source name.
* @param {int} `track` Audio tracks 1-6.
* @param {boolean} `active` Whether audio track is active or not.
*
* @api requests
* @name SetAudioTracks
* @category sources
* @since 4.9.1
*/
RpcResponse WSRequestHandler::SetAudioTracks(const RpcRequest& request)
{
if (!request.hasField("sourceName") || !request.hasField("track") || !request.hasField("active")) {
return request.failed("missing request parameters");
}
QString sourceName = obs_data_get_string(request.parameters(), "sourceName");
bool active = obs_data_get_bool(request.parameters(), "active");
int track = obs_data_get_int(request.parameters(), "track")-1;
if (sourceName.isEmpty() || track > 5 || track < 0) {
return request.failed("invalid request parameters");
}
OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8());
if (!source) {
return request.failed("specified source doesn't exist");
}
uint32_t mixers = obs_source_get_audio_mixers(source);
if (active && !(mixers & (1 << track)))
mixers |= (1 << track);
else if (mixers & (1 << track))
mixers &= ~(1 << track);
obs_source_set_audio_mixers(source, mixers);
return request.success();
}
/**
* Gets whether an audio track is active for a source.
*
* @param {String} `sourceName` Source name.
*
* @return {boolean} `track1`
* @return {boolean} `track2`
* @return {boolean} `track3`
* @return {boolean} `track4`
* @return {boolean} `track5`
* @return {boolean} `track6`
*
* @api requests
* @name GetAudioTracks
* @category sources
* @since 4.9.1
*/
RpcResponse WSRequestHandler::GetAudioTracks(const RpcRequest& request)
{
if (!request.hasField("sourceName")) {
return request.failed("missing request parameters");
}
QString sourceName = obs_data_get_string(request.parameters(), "sourceName");
if (sourceName.isEmpty()) {
return request.failed("invalid request parameters");
}
OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8());
if (!source) {
return request.failed("specified source doesn't exist");
}
uint32_t mixers = obs_source_get_audio_mixers(source);
OBSDataAutoRelease response = obs_data_create();
obs_data_set_string(response, "name", obs_source_get_name(source));
obs_data_set_bool(response, "track1", mixers & (1 << 0));
obs_data_set_bool(response, "track2", mixers & (1 << 1));
obs_data_set_bool(response, "track3", mixers & (1 << 2));
obs_data_set_bool(response, "track4", mixers & (1 << 3));
obs_data_set_bool(response, "track5", mixers & (1 << 4));
obs_data_set_bool(response, "track6", mixers & (1 << 5));
return request.success(response);
}
/**
* Get the mute status of a specified source.
*
@ -504,40 +414,6 @@ RpcResponse WSRequestHandler::ToggleMute(const RpcRequest& request)
return request.success();
}
/**
* Get the source's active status of a specified source (if it is showing in the final mix).
*
* @param {String} `sourceName` Source name.
*
* @return {boolean} `sourceActive` Source active status of the source.
*
* @api requests
* @name GetSourceActive
* @category sources
* @since 4.9.1
*/
RpcResponse WSRequestHandler::GetSourceActive(const RpcRequest& request)
{
if (!request.hasField("sourceName")) {
return request.failed("missing request parameters");
}
QString sourceName = obs_data_get_string(request.parameters(), "sourceName");
if (sourceName.isEmpty()) {
return request.failed("invalid request parameters");
}
OBSSourceAutoRelease source = obs_get_source_by_name(sourceName.toUtf8());
if (!source) {
return request.failed("specified source doesn't exist");
}
OBSDataAutoRelease response = obs_data_create();
obs_data_set_bool(response, "sourceActive", obs_source_active(source));
return request.success(response);
}
/**
* Get the audio's active status of a specified source.
*

View File

@ -12,11 +12,9 @@
* @return {boolean} `streaming` Current streaming status.
* @return {boolean} `recording` Current recording status.
* @return {boolean} `recording-paused` If recording is paused.
* @return {boolean} `virtualcam` Current virtual cam status.
* @return {boolean} `preview-only` Always false. Retrocompatibility with OBSRemote.
* @return {String (optional)} `stream-timecode` Time elapsed since streaming started (only present if currently streaming).
* @return {String (optional)} `rec-timecode` Time elapsed since recording started (only present if currently recording).
* @return {String (optional)} `virtualcam-timecode` Time elapsed since virtual cam started (only present if virtual cam currently active).
*
* @api requests
* @name GetStreamingStatus
@ -30,7 +28,6 @@ RpcResponse WSRequestHandler::GetStreamingStatus(const RpcRequest& request) {
obs_data_set_bool(data, "streaming", obs_frontend_streaming_active());
obs_data_set_bool(data, "recording", obs_frontend_recording_active());
obs_data_set_bool(data, "recording-paused", obs_frontend_recording_paused());
obs_data_set_bool(data, "virtualcam", obs_frontend_virtualcam_active());
obs_data_set_bool(data, "preview-only", false);
if (obs_frontend_streaming_active()) {
@ -43,11 +40,6 @@ RpcResponse WSRequestHandler::GetStreamingStatus(const RpcRequest& request) {
obs_data_set_string(data, "rec-timecode", recordingTimecode.toUtf8().constData());
}
if (obs_frontend_virtualcam_active()) {
QString virtualCamTimecode = events->getVirtualCamTimecode();
obs_data_set_string(data, "virtualcam-timecode", virtualCamTimecode.toUtf8().constData());
}
return request.success(data);
}

View File

@ -144,9 +144,9 @@ RpcResponse WSRequestHandler::GetTransitionPosition(const RpcRequest& request) {
* Get the current settings of a transition
*
* @param {String} `transitionName` Transition name
*
*
* @return {Object} `transitionSettings` Current transition settings
*
*
* @api requests
* @name GetTransitionSettings
* @category transitions
@ -175,9 +175,9 @@ RpcResponse WSRequestHandler::GetTransitionSettings(const RpcRequest& request) {
*
* @param {String} `transitionName` Transition name
* @param {Object} `transitionSettings` Transition settings (they can be partial)
*
*
* @return {Object} `transitionSettings` Updated transition settings
*
*
* @api requests
* @name SetTransitionSettings
* @category transitions
@ -219,8 +219,7 @@ RpcResponse WSRequestHandler::ReleaseTBar(const RpcRequest& request) {
return request.failed("studio mode not enabled");
}
OBSSourceAutoRelease transition = obs_frontend_get_current_transition();
if (obs_transition_fixed(transition)) {
if (obs_transition_fixed(obs_frontend_get_current_transition())) {
return request.failed("current transition doesn't support t-bar control");
}
@ -232,7 +231,7 @@ RpcResponse WSRequestHandler::ReleaseTBar(const RpcRequest& request) {
/**
* Set the manual position of the T-Bar (in Studio Mode) to the specified value. Will return an error if OBS is not in studio mode
* or if the current transition doesn't support T-Bar control.
*
*
* If your code needs to perform multiple successive T-Bar moves (e.g. : in an animation, or in response to a user moving a T-Bar control in your User Interface), set `release` to false and call `ReleaseTBar` later once the animation/interaction is over.
*
* @param {double} `position` T-Bar position. This value must be between 0.0 and 1.0.
@ -248,8 +247,7 @@ RpcResponse WSRequestHandler::SetTBarPosition(const RpcRequest& request) {
return request.failed("studio mode not enabled");
}
OBSSourceAutoRelease transition = obs_frontend_get_current_transition();
if (obs_transition_fixed(transition)) {
if (obs_transition_fixed(obs_frontend_get_current_transition())) {
return request.failed("current transition doesn't support t-bar control");
}

View File

@ -1,79 +0,0 @@
#include "obs-websocket.h"
#include "Utils.h"
#include "WSEvents.h"
#include "WSRequestHandler.h"
/**
* Get current virtual cam status.
*
* @return {boolean} `isVirtualCam` Current virtual camera status.
* @return {String (optional)} `virtualCamTimecode` Time elapsed since virtual cam started (only present if virtual cam currently active).
*
* @api requests
* @name GetVirtualCamStatus
* @category virtual cam
* @since 4.9.1
*/
RpcResponse WSRequestHandler::GetVirtualCamStatus(const RpcRequest& request) {
auto events = GetEventsSystem();
OBSDataAutoRelease data = obs_data_create();
obs_data_set_bool(data, "isVirtualCam", obs_frontend_virtualcam_active());
if (obs_frontend_virtualcam_active()) {
QString virtualCamTimecode = events->getVirtualCamTimecode();
obs_data_set_string(data, "virtualCamTimecode", virtualCamTimecode.toUtf8().constData());
}
return request.success(data);
}
/**
* Toggle virtual cam on or off (depending on the current virtual cam state).
*
* @api requests
* @name StartStopVirtualCam
* @category virtual cam
* @since 4.9.1
*/
RpcResponse WSRequestHandler::StartStopVirtualCam(const RpcRequest& request) {
(obs_frontend_virtualcam_active() ? obs_frontend_stop_virtualcam() : obs_frontend_start_virtualcam());
return request.success();
}
/**
* Start virtual cam.
* Will return an `error` if virtual cam is already active.
*
* @api requests
* @name StartVirtualCam
* @category virtual cam
* @since 4.9.1
*/
RpcResponse WSRequestHandler::StartVirtualCam(const RpcRequest& request) {
if (obs_frontend_virtualcam_active()) {
return request.failed("virtual cam already active");
}
obs_frontend_start_virtualcam();
return request.success();
}
/**
* Stop virtual cam.
* Will return an `error` if virtual cam is not active.
*
* @api requests
* @name StopVirtualCam
* @category virtual cam
* @since 4.9.1
*/
RpcResponse WSRequestHandler::StopVirtualCam(const RpcRequest& request) {
if (!obs_frontend_virtualcam_active()) {
return request.failed("virtual cam not active");
}
obs_frontend_stop_virtualcam();
return request.success();
}

View File

@ -60,21 +60,6 @@ WSServer::~WSServer()
stop();
}
void WSServer::serverRunner()
{
blog(LOG_INFO, "IO thread started.");
try {
_server.run();
} catch (websocketpp::exception const & e) {
blog(LOG_ERROR, "websocketpp instance returned an error: %s", e.what());
} catch (const std::exception & e) {
blog(LOG_ERROR, "websocketpp instance returned an error: %s", e.what());
} catch (...) {
blog(LOG_ERROR, "websocketpp instance returned an error");
}
blog(LOG_INFO, "IO thread exited.");
}
void WSServer::start(quint16 port, bool lockToIPv4)
{
if (_server.is_listening() && (port == _serverPort && _lockToIPv4 == lockToIPv4)) {
@ -105,8 +90,8 @@ void WSServer::start(quint16 port, bool lockToIPv4)
blog(LOG_INFO, "server: listen failed: %s", errorCodeMessage.c_str());
obs_frontend_push_ui_translation(obs_module_get_string);
QString errorTitle = tr("OBSWebsocketCompat.Server.StartFailed.Title");
QString errorMessage = tr("OBSWebsocketCompat.Server.StartFailed.Message").arg(_serverPort).arg(errorCodeMessage.c_str());
QString errorTitle = tr("OBSWebsocket.Server.StartFailed.Title");
QString errorMessage = tr("OBSWebsocket.Server.StartFailed.Message").arg(_serverPort).arg(errorCodeMessage.c_str());
obs_frontend_pop_ui_translation();
QMainWindow* mainWindow = reinterpret_cast<QMainWindow*>(obs_frontend_get_main_window());
@ -117,71 +102,46 @@ void WSServer::start(quint16 port, bool lockToIPv4)
_server.start_accept();
_serverThread = std::thread(&WSServer::serverRunner, this);
QtConcurrent::run([=]() {
blog(LOG_INFO, "io thread started");
_server.run();
blog(LOG_INFO, "io thread exited");
});
blog(LOG_INFO, "server started successfully on port %d", _serverPort);
}
void WSServer::stop()
{
auto config = GetConfig();
if (config && config->DebugEnabled)
blog(LOG_INFO, "[WSServer::stop] Stopping...");
if (!_server.is_listening()) {
if (config && config->DebugEnabled)
blog(LOG_INFO, "[WSServer::stop] Server not listening.");
return;
}
_server.stop_listening();
for (connection_hdl hdl : _connections) {
if (config && config->DebugEnabled)
blog(LOG_INFO, "[WSServer::stop] Closing an active connection...");
websocketpp::lib::error_code errorCode;
_server.pause_reading(hdl, errorCode);
if (errorCode) {
blog(LOG_ERROR, "Error: %s", errorCode.message().c_str());
continue;
}
_server.close(hdl, websocketpp::close::status::going_away, "Server stopping", errorCode);
if (errorCode) {
blog(LOG_ERROR, "Error: %s", errorCode.message().c_str());
continue;
}
if (config && config->DebugEnabled)
blog(LOG_INFO, "[WSServer::stop] Finished closing connection.");
_server.close(hdl, websocketpp::close::status::going_away, "Server stopping");
}
if (config && config->DebugEnabled)
blog(LOG_INFO, "[WSServer::stop] Stopping thread pool...");
_threadPool.waitForDone();
if (config && config->DebugEnabled)
blog(LOG_INFO, "[WSServer::stop] Waiting for all connections to close...");
while (_connections.size() > 0)
while (_connections.size() > 0) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
if (config && config->DebugEnabled)
blog(LOG_INFO, "[WSServer::stop] Performing join on IO thread...");
_serverThread.join();
blog(LOG_INFO, "Server stopped successfully.");
blog(LOG_INFO, "server stopped successfully");
}
void WSServer::broadcast(const RpcEvent& event)
{
std::string message = OBSRemoteProtocol::encodeEvent(event);
auto config = GetConfig();
if (config && config->DebugEnabled) {
if (GetConfig()->DebugEnabled) {
blog(LOG_INFO, "Update << '%s'", message.c_str());
}
QMutexLocker locker(&_clMutex);
for (connection_hdl hdl : _connections) {
if (config && config->AuthRequired) {
if (GetConfig()->AuthRequired) {
bool authenticated = _connectionProperties[hdl].isAuthenticated();
if (!authenticated) {
continue;
@ -199,11 +159,6 @@ void WSServer::broadcast(const RpcEvent& event)
}
}
bool WSServer::isListening()
{
return _server.is_listening();
}
void WSServer::onOpen(connection_hdl hdl)
{
QMutexLocker locker(&_clMutex);
@ -229,15 +184,14 @@ void WSServer::onMessage(connection_hdl hdl, server::message_ptr message)
ConnectionProperties& connProperties = _connectionProperties[hdl];
locker.unlock();
auto config = GetConfig();
if (config && config->DebugEnabled) {
if (GetConfig()->DebugEnabled) {
blog(LOG_INFO, "Request >> '%s'", payload.c_str());
}
WSRequestHandler requestHandler(connProperties);
std::string response = OBSRemoteProtocol::processMessage(requestHandler, payload);
if (config && config->DebugEnabled) {
if (GetConfig()->DebugEnabled) {
blog(LOG_INFO, "Response << '%s'", response.c_str());
}
@ -261,12 +215,11 @@ void WSServer::onClose(connection_hdl hdl)
auto conn = _server.get_con_from_hdl(hdl);
auto localCloseCode = conn->get_local_close_code();
auto localCloseReason = conn->get_local_close_reason();
QString clientIp = getRemoteEndpoint(hdl);
blog(LOG_INFO, "Websocket connection with client '%s' closed (disconnected). Code is %d, reason is: '%s'", clientIp.toUtf8().constData(), localCloseCode, localCloseReason.c_str());
if (localCloseCode != websocketpp::close::status::going_away && _server.is_listening()) {
if (localCloseCode != websocketpp::close::status::going_away) {
QString clientIp = getRemoteEndpoint(hdl);
notifyDisconnection(clientIp);
blog(LOG_INFO, "client %s disconnected", clientIp.toUtf8().constData());
}
}
@ -279,8 +232,8 @@ QString WSServer::getRemoteEndpoint(connection_hdl hdl)
void WSServer::notifyConnection(QString clientIp)
{
obs_frontend_push_ui_translation(obs_module_get_string);
QString title = tr("OBSWebsocketCompat.NotifyConnect.Title");
QString msg = tr("OBSWebsocketCompat.NotifyConnect.Message").arg(clientIp);
QString title = tr("OBSWebsocket.NotifyConnect.Title");
QString msg = tr("OBSWebsocket.NotifyConnect.Message").arg(clientIp);
obs_frontend_pop_ui_translation();
Utils::SysTrayNotify(msg, QSystemTrayIcon::Information, title);
@ -289,8 +242,8 @@ void WSServer::notifyConnection(QString clientIp)
void WSServer::notifyDisconnection(QString clientIp)
{
obs_frontend_push_ui_translation(obs_module_get_string);
QString title = tr("OBSWebsocketCompat.NotifyDisconnect.Title");
QString msg = tr("OBSWebsocketCompat.NotifyDisconnect.Message").arg(clientIp);
QString title = tr("OBSWebsocket.NotifyDisconnect.Title");
QString msg = tr("OBSWebsocket.NotifyDisconnect.Message").arg(clientIp);
obs_frontend_pop_ui_translation();
Utils::SysTrayNotify(msg, QSystemTrayIcon::Information, title);

View File

@ -26,7 +26,6 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include <QtCore/QVariantHash>
#include <QtCore/QThreadPool>
#include <asio.hpp>
#include <websocketpp/config/asio_no_tls.hpp>
#include <websocketpp/server.hpp>
@ -48,14 +47,11 @@ public:
void start(quint16 port, bool lockToIPv4);
void stop();
void broadcast(const RpcEvent& event);
bool isListening();
QThreadPool* threadPool() {
return &_threadPool;
}
private:
void serverRunner();
void onOpen(connection_hdl hdl);
void onMessage(connection_hdl hdl, server::message_ptr message);
void onClose(connection_hdl hdl);
@ -64,7 +60,6 @@ private:
void notifyConnection(QString clientIp);
void notifyDisconnection(QString clientIp);
std::thread _serverThread;
server _server;
quint16 _serverPort;
bool _lockToIPv4;

View File

@ -43,18 +43,17 @@ SettingsDialog::SettingsDialog(QWidget* parent) :
void SettingsDialog::showEvent(QShowEvent* event) {
auto conf = GetConfig();
if (conf) {
ui->serverEnabled->setChecked(conf->ServerEnabled);
ui->serverPort->setValue(conf->ServerPort);
ui->lockToIPv4->setChecked(conf->LockToIPv4);
ui->debugEnabled->setChecked(conf->DebugEnabled);
ui->alertsEnabled->setChecked(conf->AlertsEnabled);
ui->serverEnabled->setChecked(conf->ServerEnabled);
ui->serverPort->setValue(conf->ServerPort);
ui->lockToIPv4->setChecked(conf->LockToIPv4);
ui->authRequired->blockSignals(true);
ui->authRequired->setChecked(conf->AuthRequired);
ui->authRequired->blockSignals(false);
}
ui->debugEnabled->setChecked(conf->DebugEnabled);
ui->alertsEnabled->setChecked(conf->AlertsEnabled);
ui->authRequired->blockSignals(true);
ui->authRequired->setChecked(conf->AuthRequired);
ui->authRequired->blockSignals(false);
ui->password->setText(CHANGE_ME);
ui->password->setEnabled(ui->authRequired->isChecked());
@ -81,10 +80,10 @@ void SettingsDialog::AuthCheckboxChanged() {
}
else {
obs_frontend_push_ui_translation(obs_module_get_string);
QString authDisabledWarning = QObject::tr("OBSWebsocketCompat.Settings.AuthDisabledWarning");
QString authDisabledWarning = QObject::tr("OBSWebsocket.Settings.AuthDisabledWarning");
obs_frontend_pop_ui_translation();
QMessageBox::StandardButton response = QMessageBox::question(this, "obs-websocket 4.9.1-compat", authDisabledWarning);
QMessageBox::StandardButton response = QMessageBox::question(this, "obs-websocket", authDisabledWarning);
if (response == QMessageBox::Yes) {
ui->password->setEnabled(false);
} else {
@ -95,9 +94,6 @@ void SettingsDialog::AuthCheckboxChanged() {
void SettingsDialog::FormAccepted() {
auto conf = GetConfig();
if (!conf) {
return;
}
conf->ServerEnabled = ui->serverEnabled->isChecked();
conf->ServerPort = ui->serverPort->value();
@ -111,7 +107,7 @@ void SettingsDialog::FormAccepted() {
conf->SetPassword(ui->password->text());
}
if (!conf->Secret.isEmpty())
if (!GetConfig()->Secret.isEmpty())
conf->AuthRequired = true;
else
conf->AuthRequired = false;

View File

@ -17,7 +17,7 @@
</sizepolicy>
</property>
<property name="windowTitle">
<string>OBSWebsocketCompat.Settings.DialogTitle</string>
<string>OBSWebsocket.Settings.DialogTitle</string>
</property>
<property name="sizeGripEnabled">
<bool>false</bool>
@ -31,14 +31,14 @@
<item row="3" column="1">
<widget class="QCheckBox" name="authRequired">
<property name="text">
<string>OBSWebsocketCompat.Settings.AuthRequired</string>
<string>OBSWebsocket.Settings.AuthRequired</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="lbl_password">
<property name="text">
<string>OBSWebsocketCompat.Settings.Password</string>
<string>OBSWebsocket.Settings.Password</string>
</property>
</widget>
</item>
@ -52,7 +52,7 @@
<item row="1" column="1">
<widget class="QCheckBox" name="serverEnabled">
<property name="text">
<string>OBSWebsocketCompat.Settings.ServerEnable</string>
<string>OBSWebsocket.Settings.ServerEnable</string>
</property>
<property name="checked">
<bool>true</bool>
@ -62,7 +62,7 @@
<item row="2" column="0">
<widget class="QLabel" name="lbl_serverPort">
<property name="text">
<string>OBSWebsocketCompat.Settings.ServerPort</string>
<string>OBSWebsocket.Settings.ServerPort</string>
</property>
</widget>
</item>
@ -82,7 +82,7 @@
<item row="6" column="1">
<widget class="QCheckBox" name="alertsEnabled">
<property name="text">
<string>OBSWebsocketCompat.Settings.AlertsEnable</string>
<string>OBSWebsocket.Settings.AlertsEnable</string>
</property>
<property name="checked">
<bool>true</bool>
@ -92,7 +92,7 @@
<item row="7" column="1">
<widget class="QCheckBox" name="debugEnabled">
<property name="text">
<string>OBSWebsocketCompat.Settings.DebugEnable</string>
<string>OBSWebsocket.Settings.DebugEnable</string>
</property>
<property name="checked">
<bool>false</bool>
@ -102,7 +102,7 @@
<item row="5" column="1">
<widget class="QCheckBox" name="lockToIPv4">
<property name="text">
<string>OBSWebsocketCompat.Settings.LockToIPv4</string>
<string>OBSWebsocket.Settings.LockToIPv4</string>
</property>
</widget>
</item>

View File

@ -30,6 +30,12 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include "Config.h"
#include "forms/settings-dialog.h"
void ___source_dummy_addref(obs_source_t*) {}
void ___sceneitem_dummy_addref(obs_sceneitem_t*) {}
void ___data_dummy_addref(obs_data_t*) {}
void ___data_array_dummy_addref(obs_data_array_t*) {}
void ___output_dummy_addref(obs_output_t*) {}
void ___data_item_dummy_addref(obs_data_item_t*) {}
void ___data_item_release(obs_data_item_t* dataItem) {
obs_data_item_release(&dataItem);
@ -47,7 +53,6 @@ bool obs_module_load(void) {
blog(LOG_INFO, "you can haz websockets (version %s)", OBS_WEBSOCKET_VERSION);
blog(LOG_INFO, "qt version (compile-time): %s ; qt version (run-time): %s",
QT_VERSION_STR, qVersion());
blog(LOG_INFO, "[obs_module_load] Linked ASIO Version: %d", ASIO_VERSION);
// Core setup
_config = ConfigPtr(new Config());
@ -64,7 +69,7 @@ bool obs_module_load(void) {
obs_frontend_pop_ui_translation();
const char* menuActionText =
obs_module_text("OBSWebsocketCompat.Settings.DialogTitle");
obs_module_text("OBSWebsocket.Settings.DialogTitle");
QAction* menuAction =
(QAction*)obs_frontend_add_tools_menu_qaction(menuActionText);
QObject::connect(menuAction, &QAction::triggered, [] {

View File

@ -21,6 +21,23 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include <obs.hpp>
#include <memory>
void ___source_dummy_addref(obs_source_t*);
void ___sceneitem_dummy_addref(obs_sceneitem_t*);
void ___data_dummy_addref(obs_data_t*);
void ___data_array_dummy_addref(obs_data_array_t*);
void ___output_dummy_addref(obs_output_t*);
using OBSSourceAutoRelease =
OBSRef<obs_source_t*, ___source_dummy_addref, obs_source_release>;
using OBSSceneItemAutoRelease =
OBSRef<obs_sceneitem_t*, ___sceneitem_dummy_addref, obs_sceneitem_release>;
using OBSDataAutoRelease =
OBSRef<obs_data_t*, ___data_dummy_addref, obs_data_release>;
using OBSDataArrayAutoRelease =
OBSRef<obs_data_array_t*, ___data_array_dummy_addref, obs_data_array_release>;
using OBSOutputAutoRelease =
OBSRef<obs_output_t*, ___output_dummy_addref, obs_output_release>;
void ___data_item_dummy_addref(obs_data_item_t*);
void ___data_item_release(obs_data_item_t*);
using OBSDataItemAutoRelease =
@ -40,6 +57,6 @@ WSServerPtr GetServer();
WSEventsPtr GetEventsSystem();
void ShowPasswordSetting();
#define OBS_WEBSOCKET_VERSION "4.9.1-compat"
#define OBS_WEBSOCKET_VERSION "4.9.0"
#define blog(level, msg, ...) blog(level, "[obs-websocket 4.9.1-compat] " msg, ##__VA_ARGS__)
#define blog(level, msg, ...) blog(level, "[obs-websocket] " msg, ##__VA_ARGS__)

View File

@ -1,31 +0,0 @@
/*
obs-websocket
Copyright (C) 2016-2021 Stephane Lepin <stephane.lepin@gmail.com>
Copyright (C) 2020-2021 Kyle Manning <tt2468@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>
*/
#pragma once
#include <util/base.h>
#define blog(level, msg, ...) blog(level, "[obs-websocket] " msg, ##__VA_ARGS__)
#define blog_debug(msg, ...) if (IsDebugEnabled()) blog(LOG_INFO, "[debug] " msg, ##__VA_ARGS__)
#define OBS_WEBSOCKET_VERSION "5.0.0"
#define OBS_WEBSOCKET_RPC_VERSION 1
#define QT_TO_UTF8(str) str.toUtf8().constData()

View File

@ -64,15 +64,15 @@ std::string OBSRemoteProtocol::encodeEvent(const RpcEvent& event)
QString updateType = event.updateType();
obs_data_set_string(eventData, "update-type", updateType.toUtf8().constData());
auto streamTime = event.streamTime();
if (streamTime) {
QString streamingTimecode = Utils::nsToTimestamp(streamTime);
std::optional<uint64_t> streamTime = event.streamTime();
if (streamTime.has_value()) {
QString streamingTimecode = Utils::nsToTimestamp(streamTime.value());
obs_data_set_string(eventData, "stream-timecode", streamingTimecode.toUtf8().constData());
}
auto recordingTime = event.recordingTime();
if (recordingTime) {
QString recordingTimecode = Utils::nsToTimestamp(recordingTime);
std::optional<uint64_t> recordingTime = event.recordingTime();
if (recordingTime.has_value()) {
QString recordingTimecode = Utils::nsToTimestamp(recordingTime.value());
obs_data_set_string(eventData, "rec-timecode", recordingTimecode.toUtf8().constData());
}
@ -132,7 +132,7 @@ obs_data_t* OBSRemoteProtocol::buildResponse(const char* messageId, const char*
return response;
}
std::string OBSRemoteProtocol::jsonDataToString(obs_data_t *data)
std::string OBSRemoteProtocol::jsonDataToString(OBSDataAutoRelease data)
{
std::string responseString = obs_data_get_json(data);
return responseString;

View File

@ -37,5 +37,5 @@ private:
static obs_data_t* successResponse(const char* messageId, obs_data_t* fields = nullptr);
static obs_data_t* errorResponse(const char* messageId, const char* errorMessage, obs_data_t* additionalFields = nullptr);
static obs_data_t* buildResponse(const char* messageId, const char*, obs_data_t* fields = nullptr);
static std::string jsonDataToString(obs_data_t *data);
static std::string jsonDataToString(OBSDataAutoRelease data);
};

View File

@ -20,7 +20,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
RpcEvent::RpcEvent(
const QString& updateType,
uint64_t streamTime, uint64_t recordingTime,
std::optional<uint64_t> streamTime, std::optional<uint64_t> recordingTime,
obs_data_t* additionalFields
) :
_updateType(updateType),

View File

@ -18,6 +18,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#pragma once
#include <optional>
#include <obs-data.h>
#include <QtCore/QString>
@ -28,7 +29,7 @@ class RpcEvent
public:
explicit RpcEvent(
const QString& updateType,
uint64_t streamTime, uint64_t recordingTime,
std::optional<uint64_t> streamTime, std::optional<uint64_t> recordingTime,
obs_data_t* additionalFields = nullptr
);
@ -37,12 +38,12 @@ public:
return _updateType;
}
const uint64_t streamTime() const
const std::optional<uint64_t> streamTime() const
{
return _streamTime;
}
const uint64_t recordingTime() const
const std::optional<uint64_t> recordingTime() const
{
return _recordingTime;
}
@ -54,7 +55,7 @@ public:
private:
QString _updateType;
uint64_t _streamTime;
uint64_t _recordingTime;
std::optional<uint64_t> _streamTime;
std::optional<uint64_t> _recordingTime;
OBSDataAutoRelease _additionalFields;
};