Communicate via stdin/stdout with ctrl script

This commit is contained in:
badaix 2021-05-26 23:57:59 +02:00
parent 91ea368121
commit 6e6b63ec26
5 changed files with 226 additions and 82 deletions

View file

@ -438,7 +438,7 @@ void Server::processRequest(const jsonrpcpp::request_ptr request, jsonrpcpp::ent
// clang-format on
LOG(INFO, LOG_TAG) << "Stream.Control id: " << request->params().get<std::string>("id") << ", command: " << request->params().get("command")
<< "\n";
<< ", params: " << (request->params().has("params") ? request->params().get("params") : "") << "\n";
// Find stream
string streamId = request->params().get<std::string>("id");
@ -447,7 +447,7 @@ void Server::processRequest(const jsonrpcpp::request_ptr request, jsonrpcpp::ent
throw jsonrpcpp::InternalErrorException("Stream not found", request->id());
// Set metadata from request
stream->control(request->params().get("command"), request->params().has("param") ? request->params().get("param") : "");
stream->control(request->params().get("command"), request->params().has("params") ? request->params().get("params") : json{});
// Setup response
result["id"] = streamId;