mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
New request types for streaming and recording control
`StartStreaming`, `StopStreaming`, `StartRecording` and `StopRecording`
This commit is contained in:
parent
701f88e532
commit
f078a10028
41
PROTOCOL.md
41
PROTOCOL.md
@ -45,6 +45,10 @@ The protocol in general is based on the OBS Remote protocol created by Bill Hami
|
||||
- ["SetSourceRender"](#setsourcerender)
|
||||
- ["StartStopStreaming"](#startstopstreaming)
|
||||
- ["StartStopRecording"](#startstoprecording)
|
||||
- ["StartStreaming"](#startstreaming)
|
||||
- ["StopStreaming"](#stopstreaming)
|
||||
- ["StartRecording"](#startrecording)
|
||||
- ["StopRecording"](#stoprecording)
|
||||
- ["GetStreamingStatus"](#getstreamingstatus)
|
||||
- ["GetTransitionList"](#gettransitionlist)
|
||||
- ["GetCurrentTransition"](#getcurrenttransition)
|
||||
@ -56,6 +60,7 @@ The protocol in general is based on the OBS Remote protocol created by Bill Hami
|
||||
- ["ToggleMute"](#togglemute)
|
||||
- ["SetSceneItemPosition"](#setsceneitemposition)
|
||||
- ["SetSceneItemTransform"](#setsceneitemtransform)
|
||||
- ["SetSceneItemCrop"](#setsceneitemcrop)
|
||||
- ["SetCurrentSceneCollection"](#setcurrentscenecollection)
|
||||
- ["GetCurrentSceneCollection"](#getcurrentscenecollection)
|
||||
- ["ListSceneCollections"](#listscenecollections)
|
||||
@ -346,6 +351,42 @@ __Response__ : always OK. No additional fields.
|
||||
|
||||
---
|
||||
|
||||
#### "StartStreaming"
|
||||
Start streaming.
|
||||
|
||||
__Request fields__ : none
|
||||
__Response__ : always OK. No additional fields.
|
||||
*New in OBS Studio*
|
||||
|
||||
---
|
||||
|
||||
#### "StopStreaming"
|
||||
Stop streaming.
|
||||
|
||||
__Request fields__ : none
|
||||
__Response__ : always OK. No additional fields.
|
||||
*New in OBS Studio*
|
||||
|
||||
---
|
||||
|
||||
#### "StartRecording"
|
||||
Start recording.
|
||||
|
||||
__Request fields__ : none
|
||||
__Response__ : always OK. No additional fields.
|
||||
*New in OBS Studio*
|
||||
|
||||
---
|
||||
|
||||
#### "StopRecording"
|
||||
Stop recording.
|
||||
|
||||
__Request fields__ : none
|
||||
__Response__ : always OK. No additional fields.
|
||||
*New in OBS Studio*
|
||||
|
||||
---
|
||||
|
||||
#### "GetStreamingStatus"
|
||||
Get current streaming and recording status.
|
||||
|
||||
|
@ -46,6 +46,10 @@ WSRequestHandler::WSRequestHandler(QWebSocket *client) :
|
||||
messageMap["GetStreamingStatus"] = WSRequestHandler::HandleGetStreamingStatus;
|
||||
messageMap["StartStopStreaming"] = WSRequestHandler::HandleStartStopStreaming;
|
||||
messageMap["StartStopRecording"] = WSRequestHandler::HandleStartStopRecording;
|
||||
messageMap["StartStreaming"] = WSRequestHandler::HandleStartStreaming;
|
||||
messageMap["StopStreaming"] = WSRequestHandler::HandleStopStreaming;
|
||||
messageMap["StartRecording"] = WSRequestHandler::HandleStartRecording;
|
||||
messageMap["StopRecording"] = WSRequestHandler::HandleStopRecording;
|
||||
|
||||
messageMap["GetTransitionList"] = WSRequestHandler::HandleGetTransitionList;
|
||||
messageMap["GetCurrentTransition"] = WSRequestHandler::HandleGetCurrentTransition;
|
||||
@ -325,6 +329,38 @@ void WSRequestHandler::HandleStartStopRecording(WSRequestHandler *owner)
|
||||
owner->SendOKResponse();
|
||||
}
|
||||
|
||||
void WSRequestHandler::HandleStartStreaming(WSRequestHandler *owner)
|
||||
{
|
||||
if (obs_frontend_streaming_active() == false)
|
||||
obs_frontend_streaming_start();
|
||||
|
||||
owner->SendOKResponse();
|
||||
}
|
||||
|
||||
void WSRequestHandler::HandleStopStreaming(WSRequestHandler *owner)
|
||||
{
|
||||
if (obs_frontend_streaming_active() == true)
|
||||
obs_frontend_streaming_stop();
|
||||
|
||||
owner->SendOKResponse();
|
||||
}
|
||||
|
||||
void WSRequestHandler::HandleStartRecording(WSRequestHandler *owner)
|
||||
{
|
||||
if (obs_frontend_recording_active() == false)
|
||||
obs_frontend_recording_start();
|
||||
|
||||
owner->SendOKResponse();
|
||||
}
|
||||
|
||||
void WSRequestHandler::HandleStopRecording(WSRequestHandler *owner)
|
||||
{
|
||||
if (obs_frontend_recording_active() == true)
|
||||
obs_frontend_recording_stop();
|
||||
|
||||
owner->SendOKResponse();
|
||||
}
|
||||
|
||||
void WSRequestHandler::HandleGetTransitionList(WSRequestHandler *owner)
|
||||
{
|
||||
obs_source_t *current_transition = obs_frontend_get_current_transition();
|
||||
|
@ -61,11 +61,11 @@ class WSRequestHandler : public QObject
|
||||
|
||||
static void HandleGetStreamingStatus(WSRequestHandler *owner);
|
||||
static void HandleStartStopStreaming(WSRequestHandler *owner);
|
||||
// TODO : StartStreaming
|
||||
// TODO : StopStreaming
|
||||
static void HandleStartStopRecording(WSRequestHandler *owner);
|
||||
// TODO : StartRecording
|
||||
// TODO : StopRecording
|
||||
static void HandleStartStreaming(WSRequestHandler *owner);
|
||||
static void HandleStopStreaming(WSRequestHandler *owner);
|
||||
static void HandleStartRecording(WSRequestHandler *owner);
|
||||
static void HandleStopRecording(WSRequestHandler *owner);
|
||||
|
||||
static void HandleGetTransitionList(WSRequestHandler *owner);
|
||||
static void HandleGetCurrentTransition(WSRequestHandler *owner);
|
||||
|
Loading…
x
Reference in New Issue
Block a user