mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
commit
c12a4323e7
@ -34,6 +34,7 @@ git checkout $OBSLatestTag
|
||||
mkdir build && cd build
|
||||
echo "[obs-websocket] Building obs-studio.."
|
||||
cmake .. \
|
||||
-DBUILD_CAPTIONS=true \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 \
|
||||
-DDISABLE_PLUGINS=true \
|
||||
-DDepsPath=/tmp/obsdeps \
|
||||
|
@ -108,12 +108,12 @@ if defined BuildOBS (
|
||||
mkdir build64
|
||||
echo Running cmake for obs-studio %OBSLatestTag% 32-bit...
|
||||
cd ./build32
|
||||
cmake -G "Visual Studio 14 2015" -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
|
||||
cmake -G "Visual Studio 14 2015" -DBUILD_CAPTIONS=true -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 14 2015 Win64" -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
|
||||
cmake -G "Visual Studio 14 2015 Win64" -DBUILD_CAPTIONS=true -DDISABLE_PLUGINS=true -DCOPIED_DEPENDENCIES=false -DCOPY_DEPENDENCIES=true ..
|
||||
echo:
|
||||
echo:
|
||||
echo Building obs-studio %OBSLatestTag% 32-bit ^(Build Config: %build_config%^)...
|
||||
|
@ -103,6 +103,9 @@ QHash<QString, HandlerResponse(*)(WSRequestHandler*)> WSRequestHandler::messageM
|
||||
{ "SetStreamSettings", WSRequestHandler::HandleSetStreamSettings },
|
||||
{ "GetStreamSettings", WSRequestHandler::HandleGetStreamSettings },
|
||||
{ "SaveStreamSettings", WSRequestHandler::HandleSaveStreamSettings },
|
||||
#if BUILD_CAPTIONS
|
||||
{ "SendCaptions", WSRequestHandler::HandleSendCaptions },
|
||||
#endif
|
||||
|
||||
{ "GetStudioModeStatus", WSRequestHandler::HandleGetStudioModeStatus },
|
||||
{ "GetPreviewScene", WSRequestHandler::HandleGetPreviewScene },
|
||||
|
@ -128,6 +128,9 @@ class WSRequestHandler : public QObject {
|
||||
static HandlerResponse HandleSetStreamSettings(WSRequestHandler* req);
|
||||
static HandlerResponse HandleGetStreamSettings(WSRequestHandler* req);
|
||||
static HandlerResponse HandleSaveStreamSettings(WSRequestHandler* req);
|
||||
#if BUILD_CAPTIONS
|
||||
static HandlerResponse HandleSendCaptions(WSRequestHandler * req);
|
||||
#endif
|
||||
|
||||
static HandlerResponse HandleSetTransitionDuration(WSRequestHandler* req);
|
||||
static HandlerResponse HandleGetTransitionDuration(WSRequestHandler* req);
|
||||
|
@ -287,3 +287,31 @@ HandlerResponse WSRequestHandler::HandleSaveStreamSettings(WSRequestHandler* req
|
||||
obs_frontend_save_streaming_service();
|
||||
return req->SendOKResponse();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send the provided text as embedded CEA-608 caption data.
|
||||
* As of OBS Studio 23.1, captions are not yet available on Linux.
|
||||
*
|
||||
* @param {String} `text` Captions text
|
||||
*
|
||||
* @api requests
|
||||
* @name SendCaptions
|
||||
* @category streaming
|
||||
*/
|
||||
#if BUILD_CAPTIONS
|
||||
HandlerResponse WSRequestHandler::HandleSendCaptions(WSRequestHandler* req) {
|
||||
if (!req->hasField("text")) {
|
||||
return req->SendErrorResponse("missing request parameters");
|
||||
}
|
||||
|
||||
OBSOutputAutoRelease output = obs_frontend_get_streaming_output();
|
||||
if (output) {
|
||||
const char* caption = obs_data_get_string(req->data, "text");
|
||||
obs_output_output_caption_text1(output, caption);
|
||||
}
|
||||
|
||||
return req->SendOKResponse();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user