Compare commits

...

6 Commits
5.3.4 ... 5.2.3

Author SHA1 Message Date
6fd18a7ef1 base: Update version to 5.2.3 2023-06-15 19:04:19 -04:00
1d0e624e2d eventhandler: Handle cases of current program scene being null 2023-06-15 19:04:19 -04:00
d978de1310 eventhandler: Use OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN for exit
Fixes #1136
2023-06-15 19:04:19 -04:00
36bd710ce6 docs(ci): Update generated docs - d518541 [skip ci] 2023-06-15 19:04:19 -04:00
c2d1c70f68 requesthandler: Add NotReady request status
During scene collection change and OBS exit, performing requests
constitutes undefined behavior. Previously, we attempted to help this
by providing the `SceneCollectionChanging` event for any clients to
pause requests client-side, but this method has proven to not be
adequate to fix the issue. As such, this allows us to tell clients
explicitly that a request cannot be fulfilled reliably, and they
may decide whether or not to retry.
2023-06-15 19:04:19 -04:00
f3b69a5241 cmake: Silences Qt warnings emitted by clang with default Xcode settings 2023-06-15 19:04:19 -04:00
7 changed files with 42 additions and 5 deletions

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16...3.25)
legacy_check()
set(obs-websocket_VERSION 5.2.2)
set(obs-websocket_VERSION 5.2.3)
set(OBS_WEBSOCKET_RPC_VERSION 1)
option(ENABLE_WEBSOCKET "Enable building OBS with websocket plugin" ON)
@ -142,7 +142,7 @@ target_compile_options(
$<$<PLATFORM_ID:Darwin,Linux,FreeBSD>:-Wall>
$<$<COMPILE_LANG_AND_ID:CXX,GNU,AppleClang,Clang>:-Wno-error=float-conversion;-Wno-error=shadow>
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-error=format-overflow;-Wno-error=int-conversion;-Wno-error=comment>
$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang>:-Wno-error=null-pointer-subtraction;-Wno-error=deprecated-declarations;-Wno-error=implicit-int-conversion;-Wno-error=shorten-64-to-32>
$<$<COMPILE_LANG_AND_ID:CXX,AppleClang,Clang>:-Wno-error=null-pointer-subtraction;-Wno-error=deprecated-declarations;-Wno-error=implicit-int-conversion;-Wno-error=shorten-64-to-32;-Wno-comma;-Wno-quoted-include-in-framework-header>
)
target_link_libraries(

View File

@ -1,4 +1,4 @@
project(obs-websocket VERSION 5.2.2)
project(obs-websocket VERSION 5.2.3)
set(OBS_WEBSOCKET_RPC_VERSION 1)
option(ENABLE_WEBSOCKET "Enable building OBS with websocket plugin" ON)

View File

@ -237,6 +237,14 @@
"initialVersion": "5.0.0",
"enumValue": 206
},
{
"description": "The server is not ready to handle the request.\n\nNote: This usually occurs during OBS scene collection change or exit. Requests may be tried again after a delay if this code is given.",
"enumIdentifier": "NotReady",
"rpcVersion": "1",
"deprecated": false,
"initialVersion": "5.3.0",
"enumValue": 207
},
{
"description": "A required request field is missing.",
"enumIdentifier": "MissingRequestField",

View File

@ -471,6 +471,7 @@ These are enumeration declarations, which are referenced throughout obs-websocke
- [RequestStatus::UnknownRequestType](#requeststatusunknownrequesttype)
- [RequestStatus::GenericError](#requeststatusgenericerror)
- [RequestStatus::UnsupportedRequestBatchExecutionType](#requeststatusunsupportedrequestbatchexecutiontype)
- [RequestStatus::NotReady](#requeststatusnotready)
- [RequestStatus::MissingRequestField](#requeststatusmissingrequestfield)
- [RequestStatus::MissingRequestData](#requeststatusmissingrequestdata)
- [RequestStatus::InvalidRequestField](#requeststatusinvalidrequestfield)
@ -879,6 +880,18 @@ The request batch execution type is not supported.
---
### RequestStatus::NotReady
The server is not ready to handle the request.
Note: This usually occurs during OBS scene collection change or exit. Requests may be tried again after a delay if this code is given.
- Identifier Value: `207`
- Latest Supported RPC Version: `1`
- Added in v5.3.0
---
### RequestStatus::MissingRequestField
A required request field is missing.

View File

@ -269,7 +269,7 @@ void EventHandler::OnFrontendEvent(enum obs_frontend_event event, void *private_
case OBS_FRONTEND_EVENT_FINISHED_LOADING:
eventHandler->FrontendFinishedLoadingMultiHandler();
break;
case OBS_FRONTEND_EVENT_EXIT:
case OBS_FRONTEND_EVENT_SCRIPTING_SHUTDOWN:
eventHandler->FrontendExitMultiHandler();
break;

View File

@ -103,7 +103,10 @@ void EventHandler::HandleCurrentProgramSceneChanged()
OBSSourceAutoRelease currentScene = obs_frontend_get_current_scene();
json eventData;
eventData["sceneName"] = obs_source_get_name(currentScene);
if (currentScene)
eventData["sceneName"] = obs_source_get_name(currentScene);
else
eventData["sceneName"] = nullptr;
BroadcastEvent(EventSubscription::Scenes, "CurrentProgramSceneChanged", eventData);
}

View File

@ -103,6 +103,19 @@ namespace RequestStatus {
* @api enums
*/
UnsupportedRequestBatchExecutionType = 206,
/**
* The server is not ready to handle the request.
*
* Note: This usually occurs during OBS scene collection change or exit. Requests may be tried again after a delay if this code is given.
*
* @enumIdentifier NotReady
* @enumValue 207
* @enumType RequestStatus
* @rpcVersion -1
* @initialVersion 5.3.0
* @api enums
*/
NotReady = 207,
/**
* A required request field is missing.