diff --git a/src/requesthandler/RequestHandler.cpp b/src/requesthandler/RequestHandler.cpp index 9383ca7e3..3a171578d 100644 --- a/src/requesthandler/RequestHandler.cpp +++ b/src/requesthandler/RequestHandler.cpp @@ -159,6 +159,7 @@ const std::unordered_map RequestHandler::_han {"StopOutput", &RequestHandler::StopOutput}, {"GetOutputSettings", &RequestHandler::GetOutputSettings}, {"SetOutputSettings", &RequestHandler::SetOutputSettings}, + {"SaveOutputScreenshot", &RequestHandler::SaveOutputScreenshot}, // Stream {"GetStreamStatus", &RequestHandler::GetStreamStatus}, diff --git a/src/requesthandler/RequestHandler.h b/src/requesthandler/RequestHandler.h index a3c24963c..cf4657e66 100644 --- a/src/requesthandler/RequestHandler.h +++ b/src/requesthandler/RequestHandler.h @@ -178,6 +178,7 @@ class RequestHandler { RequestResult StopOutput(const Request &); RequestResult GetOutputSettings(const Request &); RequestResult SetOutputSettings(const Request &); + RequestResult SaveOutputScreenshot(const Request &); // Stream RequestResult GetStreamStatus(const Request &); diff --git a/src/requesthandler/RequestHandler_Outputs.cpp b/src/requesthandler/RequestHandler_Outputs.cpp index 45bca638e..d0bd67451 100644 --- a/src/requesthandler/RequestHandler_Outputs.cpp +++ b/src/requesthandler/RequestHandler_Outputs.cpp @@ -488,3 +488,20 @@ RequestResult RequestHandler::SetOutputSettings(const Request &request) return RequestResult::Success(); } + +/** + * Saves a screenshot of a output to the filesystem. + * + * @requestType SaveOutputScreenshot + * @complexity 1 + * @rpcVersion -1 + * @initialVersion 5.2.3 + * @api requests + * @category outputs + */ +RequestResult RequestHandler::SaveOutputScreenshot(const Request &) +{ + json responseData; + obs_frontend_take_screenshot(); + return RequestResult::Success(responseData); +}