Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests: Add SaveOutputScreenshot #1156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/requesthandler/RequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ const std::unordered_map<std::string, RequestMethodHandler> RequestHandler::_han
{"StopOutput", &RequestHandler::StopOutput},
{"GetOutputSettings", &RequestHandler::GetOutputSettings},
{"SetOutputSettings", &RequestHandler::SetOutputSettings},
{"SaveOutputScreenshot", &RequestHandler::SaveOutputScreenshot},

// Stream
{"GetStreamStatus", &RequestHandler::GetStreamStatus},
Expand Down
1 change: 1 addition & 0 deletions src/requesthandler/RequestHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 &);
Expand Down
17 changes: 17 additions & 0 deletions src/requesthandler/RequestHandler_Outputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}