hardcoded decklink mode fix
This commit is contained in:
@@ -254,8 +254,29 @@ static void handle_request(const std::string& method, const std::string& path,
|
||||
return;
|
||||
}
|
||||
|
||||
int fps_num = 50, fps_den = 1;
|
||||
int width = 1920, height = 1080;
|
||||
|
||||
nlohmann::json status_cmd;
|
||||
status_cmd["cmd"] = "status";
|
||||
auto status_resp = cc.send_command_with_response(port_num, status_cmd.dump());
|
||||
if (!status_resp.empty()) {
|
||||
try {
|
||||
auto sr = nlohmann::json::parse(status_resp);
|
||||
if (sr.contains("data")) {
|
||||
auto& d = sr["data"];
|
||||
if (d.contains("grain_rate")) {
|
||||
fps_num = d["grain_rate"].value("numerator", fps_num);
|
||||
fps_den = d["grain_rate"].value("denominator", fps_den);
|
||||
}
|
||||
width = d.value("width", width);
|
||||
height = d.value("height", height);
|
||||
}
|
||||
} catch (...) {}
|
||||
}
|
||||
|
||||
auto flow_id = fm.create_flow_id();
|
||||
auto flow_def = fm.create_v210_flow_def(flow_id, 1920, 1080, 50, 1);
|
||||
auto flow_def = fm.create_v210_flow_def(flow_id, width, height, fps_num, fps_den);
|
||||
|
||||
nlohmann::json cmd;
|
||||
cmd["cmd"] = "add_writer";
|
||||
|
||||
Reference in New Issue
Block a user