requests(streaming): conditional compilation of SendCaptions

This commit is contained in:
Stéphane L 2019-04-16 22:51:22 +02:00
parent 190f5ebfc4
commit fd1c4abad7
3 changed files with 12 additions and 5 deletions

View File

@ -103,7 +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 },

View File

@ -128,7 +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);

View File

@ -290,7 +290,8 @@ HandlerResponse WSRequestHandler::HandleSaveStreamSettings(WSRequestHandler* req
/**
* Send the provided text as embedded CEA-608 caption data
* 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
*
@ -298,6 +299,7 @@ HandlerResponse WSRequestHandler::HandleSaveStreamSettings(WSRequestHandler* req
* @name SendCaptions
* @category streaming
*/
#if BUILD_CAPTIONS
HandlerResponse WSRequestHandler::HandleSendCaptions(WSRequestHandler* req) {
if (!req->hasField("text")) {
return req->SendErrorResponse("missing request parameters");
@ -311,4 +313,5 @@ HandlerResponse WSRequestHandler::HandleSendCaptions(WSRequestHandler* req) {
return req->SendOKResponse();
}
#endif