Compare commits

...

8 Commits

Author SHA1 Message Date
d465dd3110 CI: Disable VST on Windows
Since master doesn't have the submodule, switching from master to
27.2.4 doesn't download the submodule. We can just disable it
2022-08-02 14:52:49 -07:00
a89f47e720 CI: Force OBS version to 27.2.4
The recent tag messed up CI
2022-08-02 14:43:43 -07:00
952a1f914e base: Update version to 5.0.1 2022-08-02 14:35:13 -07:00
816c1b278b requesthandler: Allow empty object in Set*PrivateSettings requests
Requested by #958

Closes #958
2022-08-02 14:33:35 -07:00
2daba572e8 eventhandler: Provide outputPath on OUTPUT_STARTED too
4.x apparently included this path during output start along with stop.
It appears safe to include this on output start.

Closes #963
2022-08-02 14:33:25 -07:00
02ccd0b76f websocketserver: Validate op field type
Could cause a crash by assuming `op` is always a number.

Closes #965
2022-08-02 14:33:15 -07:00
f95865c2c4 base: Fix MSVC warning about misdeclared Config struct 2022-08-02 14:33:06 -07:00
4dc5229c49 requesthandler: Fix OpenVideoMixProjector program option
It was stuck opening preview regardless of setting.
2022-08-02 14:32:58 -07:00
10 changed files with 25 additions and 18 deletions

View File

@ -49,6 +49,7 @@ body:
label: OBS Studio Version label: OBS Studio Version
description: What version of OBS Studio are you using? description: What version of OBS Studio are you using?
options: options:
- 28.0.0
- 27.2.4 - 27.2.4
- 27.2.3 - 27.2.3
- 27.2.2 - 27.2.2
@ -75,12 +76,9 @@ body:
label: obs-websocket Version label: obs-websocket Version
description: What version of obs-websocket are you using? description: What version of obs-websocket are you using?
options: options:
- 5.0.1
- 5.0.0 - 5.0.0
- 5.0.0-beta1 - 5.0.0-beta1
- 5.0.0-alpha3
- 5.0.0-alpha2
- 4.9.1
- 4.9.0
- Git - Git
validations: validations:
required: true required: true

View File

@ -47,7 +47,8 @@ jobs:
run: | run: |
git fetch --prune --unshallow git fetch --prune --unshallow
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV echo "OBS_GIT_TAG=27.2.4" >> $GITHUB_ENV
# echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: 'Checkout last OBS Studio release (${{ env.OBS_GIT_TAG }})' - name: 'Checkout last OBS Studio release (${{ env.OBS_GIT_TAG }})'
shell: bash shell: bash
working-directory: ${{ github.workspace }}/obs-studio working-directory: ${{ github.workspace }}/obs-studio
@ -110,7 +111,7 @@ jobs:
run: | run: |
if(!(Test-Path -Path ".\build32")){New-Item -ItemType directory -Path .\build32} if(!(Test-Path -Path ".\build32")){New-Item -ItemType directory -Path .\build32}
cd .\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 }}\msvc2019" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES -DBUILD_BROWSER=OFF .. cmake -G "${{ env.CMAKE_GENERATOR }}" -A Win32 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win32" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES -DBUILD_BROWSER=OFF -DBUILD_VST=OFF ..
- name: 'Build OBS Studio 32-bit' - name: 'Build OBS Studio 32-bit'
if: steps.build-cache-obs-32.outputs.cache-hit != 'true' if: steps.build-cache-obs-32.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio working-directory: ${{ github.workspace }}/obs-studio
@ -131,7 +132,7 @@ jobs:
run: | run: |
if(!(Test-Path -Path ".\build64")){New-Item -ItemType directory -Path .\build64} if(!(Test-Path -Path ".\build64")){New-Item -ItemType directory -Path .\build64}
cd .\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 }}\msvc2019_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES -DBUILD_BROWSER=OFF .. cmake -G "${{ env.CMAKE_GENERATOR }}" -A x64 -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DQTDIR="${{ github.workspace }}\cmbuild\QT\${{ env.QT_VERSION }}\msvc2019_64" -DDepsPath="${{ github.workspace }}\cmbuild\deps\win64" -DCOPIED_DEPENDENCIES=NO -DCOPY_DEPENDENCIES=YES -DBUILD_BROWSER=OFF -DBUILD_VST=OFF ..
- name: 'Build OBS Studio 64-bit' - name: 'Build OBS Studio 64-bit'
if: steps.build-cache-obs-64.outputs.cache-hit != 'true' if: steps.build-cache-obs-64.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio working-directory: ${{ github.workspace }}/obs-studio
@ -201,7 +202,8 @@ jobs:
run: | run: |
git fetch --prune --unshallow git fetch --prune --unshallow
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV echo "OBS_GIT_TAG=27.2.4" >> $GITHUB_ENV
# echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: 'Checkout last OBS Studio release (${{ env.OBS_GIT_TAG }})' - name: 'Checkout last OBS Studio release (${{ env.OBS_GIT_TAG }})'
shell: bash shell: bash
working-directory: ${{ github.workspace }}/obs-studio working-directory: ${{ github.workspace }}/obs-studio
@ -388,7 +390,8 @@ jobs:
run: | run: |
git fetch --prune --unshallow git fetch --prune --unshallow
echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "OBS_GIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV echo "OBS_GIT_TAG=27.2.4" >> $GITHUB_ENV
# echo "OBS_GIT_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- name: 'Checkout last OBS Studio release (${{ env.OBS_GIT_TAG }})' - name: 'Checkout last OBS Studio release (${{ env.OBS_GIT_TAG }})'
shell: bash shell: bash
working-directory: ${{ github.workspace }}/obs-studio working-directory: ${{ github.workspace }}/obs-studio

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.16...3.20) cmake_minimum_required(VERSION 3.16...3.20)
# Version variables # Version variables
project(obs-websocket VERSION 5.0.0) project(obs-websocket VERSION 5.0.1)
set(OBS_WEBSOCKET_RPC_VERSION 1) set(OBS_WEBSOCKET_RPC_VERSION 1)

View File

@ -1,5 +1,5 @@
# obs-websocket 5.0.0 Protocol # obs-websocket 5.0.1 Protocol
## Main Table of Contents ## Main Table of Contents
@ -143,7 +143,7 @@ Authentication is required
{ {
"op": 0, "op": 0,
"d": { "d": {
"obsWebSocketVersion": "5.0.0", "obsWebSocketVersion": "5.0.1",
"rpcVersion": 1, "rpcVersion": 1,
"authentication": { "authentication": {
"challenge": "+IxH4CnCiqpX1rM9scsNynZzbOe4KhDeYcTNS3PDaeY=", "challenge": "+IxH4CnCiqpX1rM9scsNynZzbOe4KhDeYcTNS3PDaeY=",
@ -159,7 +159,7 @@ Authentication is not required
{ {
"op": 0, "op": 0,
"d": { "d": {
"obsWebSocketVersion": "5.0.0", "obsWebSocketVersion": "5.0.1",
"rpcVersion": 1 "rpcVersion": 1
} }
} }

View File

@ -77,7 +77,7 @@ void EventHandler::HandleRecordStateChanged(ObsOutputState state)
json eventData; json eventData;
eventData["outputActive"] = GetOutputStateActive(state); eventData["outputActive"] = GetOutputStateActive(state);
eventData["outputState"] = state; eventData["outputState"] = state;
if (state == OBS_WEBSOCKET_OUTPUT_STOPPED) { if (state == OBS_WEBSOCKET_OUTPUT_STOPPED || state == OBS_WEBSOCKET_OUTPUT_STARTED) {
eventData["outputPath"] = Utils::Obs::StringHelper::GetLastRecordFileName(); eventData["outputPath"] = Utils::Obs::StringHelper::GetLastRecordFileName();
} else { } else {
eventData["outputPath"] = nullptr; eventData["outputPath"] = nullptr;

View File

@ -26,7 +26,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#include "utils/Obs.h" #include "utils/Obs.h"
#include "plugin-macros.generated.h" #include "plugin-macros.generated.h"
class Config; struct Config;
typedef std::shared_ptr<Config> ConfigPtr; typedef std::shared_ptr<Config> ConfigPtr;
class EventHandler; class EventHandler;

View File

@ -759,7 +759,7 @@ RequestResult RequestHandler::SetSceneItemPrivateSettings(const Request &request
std::string comment; std::string comment;
OBSSceneItemAutoRelease sceneItem = request.ValidateSceneItem("sceneName", "sceneItemId", statusCode, comment, OBSSceneItemAutoRelease sceneItem = request.ValidateSceneItem("sceneName", "sceneItemId", statusCode, comment,
OBS_WEBSOCKET_SCENE_FILTER_SCENE_OR_GROUP); OBS_WEBSOCKET_SCENE_FILTER_SCENE_OR_GROUP);
if (!sceneItem || !request.ValidateObject("sceneItemSettings", statusCode, comment)) if (!sceneItem || !request.ValidateObject("sceneItemSettings", statusCode, comment, true))
return RequestResult::Error(statusCode, comment); return RequestResult::Error(statusCode, comment);
OBSDataAutoRelease privateSettings = obs_sceneitem_get_private_settings(sceneItem); OBSDataAutoRelease privateSettings = obs_sceneitem_get_private_settings(sceneItem);

View File

@ -339,7 +339,7 @@ RequestResult RequestHandler::SetSourcePrivateSettings(const Request &request)
RequestStatus::RequestStatus statusCode; RequestStatus::RequestStatus statusCode;
std::string comment; std::string comment;
OBSSourceAutoRelease source = request.ValidateSource("sourceName", statusCode, comment); OBSSourceAutoRelease source = request.ValidateSource("sourceName", statusCode, comment);
if (!source || !request.ValidateObject("sourceSettings", statusCode, comment)) if (!source || !request.ValidateObject("sourceSettings", statusCode, comment, true))
return RequestResult::Error(statusCode, comment); return RequestResult::Error(statusCode, comment);
OBSDataAutoRelease privateSettings = obs_source_get_private_settings(source); OBSDataAutoRelease privateSettings = obs_source_get_private_settings(source);

View File

@ -228,7 +228,7 @@ RequestResult RequestHandler::OpenVideoMixProjector(const Request &request)
if (videoMixType == "OBS_WEBSOCKET_VIDEO_MIX_TYPE_PREVIEW") if (videoMixType == "OBS_WEBSOCKET_VIDEO_MIX_TYPE_PREVIEW")
projectorType = "Preview"; projectorType = "Preview";
else if (videoMixType == "OBS_WEBSOCKET_VIDEO_MIX_TYPE_PROGRAM") else if (videoMixType == "OBS_WEBSOCKET_VIDEO_MIX_TYPE_PROGRAM")
projectorType = "Program"; projectorType = "StudioProgram";
else if (videoMixType == "OBS_WEBSOCKET_VIDEO_MIX_TYPE_MULTIVIEW") else if (videoMixType == "OBS_WEBSOCKET_VIDEO_MIX_TYPE_MULTIVIEW")
projectorType = "Multiview"; projectorType = "Multiview";
else else

View File

@ -445,6 +445,12 @@ void WebSocketServer::onMessage(websocketpp::connection_hdl hdl,
goto skipProcessing; goto skipProcessing;
} }
if (!incomingMessage["op"].is_number()) {
ret.closeCode = WebSocketCloseCode::UnknownOpCode;
ret.closeReason = "Your `op` is not a number.";
goto skipProcessing;
}
ProcessMessage(session, ret, incomingMessage["op"], incomingMessage["d"]); ProcessMessage(session, ret, incomingMessage["op"], incomingMessage["d"]);
skipProcessing: skipProcessing: