Rename Input Only to Remote Input

This commit is contained in:
Yukino Song
2025-02-06 05:24:19 +08:00
parent 68d1b5ce9d
commit 786fadb960
4 changed files with 13 additions and 10 deletions
+3 -3
View File
@@ -1053,7 +1053,7 @@ namespace nvhttp {
auto named_cert_p = get_verified_cert(request); auto named_cert_p = get_verified_cert(request);
if (!!(named_cert_p->perm & PERM::_all_actions)) { if (!!(named_cert_p->perm & PERM::_all_actions)) {
auto current_appid = proc::proc.running(); auto current_appid = proc::proc.running();
auto input_only_id_int = util::from_view(proc::input_only_app_id); auto input_only_id_int = proc::input_only_app_id;
auto should_hide_inactive_apps = config::input.enable_input_only_mode && current_appid > 0 && current_appid != input_only_id_int; auto should_hide_inactive_apps = config::input.enable_input_only_mode && current_appid > 0 && current_appid != input_only_id_int;
for (auto &app : proc::proc.get_apps()) { for (auto &app : proc::proc.get_apps()) {
auto appid = util::from_view(app.id); auto appid = util::from_view(app.id);
@@ -1108,7 +1108,7 @@ namespace nvhttp {
auto appid_str = get_arg(args, "appid"); auto appid_str = get_arg(args, "appid");
auto appid = util::from_view(appid_str); auto appid = util::from_view(appid_str);
auto current_appid = proc::proc.running(); auto current_appid = proc::proc.running();
bool is_input_only = config::input.enable_input_only_mode && appid_str == proc::input_only_app_id; bool is_input_only = config::input.enable_input_only_mode && appid == proc::input_only_app_id;
auto named_cert_p = get_verified_cert(request); auto named_cert_p = get_verified_cert(request);
auto perm = PERM::launch; auto perm = PERM::launch;
@@ -1140,7 +1140,7 @@ namespace nvhttp {
} }
if (!is_input_only) { if (!is_input_only) {
if (current_appid > 0 && current_appid != util::from_view(proc::input_only_app_id) && appid != current_appid) { if (current_appid > 0 && current_appid != proc::input_only_app_id && appid != current_appid) {
tree.put("root.resume", 0); tree.put("root.resume", 0);
tree.put("root.<xmlattr>.status_code", 400); tree.put("root.<xmlattr>.status_code", 400);
tree.put("root.<xmlattr>.status_message", "An app is already running on this host"); tree.put("root.<xmlattr>.status_message", "An app is already running on this host");
+8 -6
View File
@@ -49,7 +49,8 @@ namespace proc {
proc_t proc; proc_t proc;
std::string input_only_app_id; int input_only_app_id = -1;
std::string input_only_app_id_str;
#ifdef _WIN32 #ifdef _WIN32
VDISPLAY::DRIVER_STATUS vDisplayDriverStatus = VDISPLAY::DRIVER_STATUS::UNKNOWN; VDISPLAY::DRIVER_STATUS vDisplayDriverStatus = VDISPLAY::DRIVER_STATUS::UNKNOWN;
@@ -162,8 +163,8 @@ namespace proc {
void void
proc_t::launch_input_only() { proc_t::launch_input_only() {
_app_id = util::from_view(input_only_app_id); _app_id = input_only_app_id;
_app_name = "Input Only"; _app_name = "Remote Input";
allow_client_commands = false; allow_client_commands = false;
placebo = true; placebo = true;
@@ -174,7 +175,7 @@ namespace proc {
int int
proc_t::execute(int app_id, const ctx_t& app, std::shared_ptr<rtsp_stream::launch_session_t> launch_session) { proc_t::execute(int app_id, const ctx_t& app, std::shared_ptr<rtsp_stream::launch_session_t> launch_session) {
if (_app_id == util::from_view(input_only_app_id)) { if (_app_id == input_only_app_id) {
terminate(); terminate();
std::this_thread::sleep_for(1s); std::this_thread::sleep_for(1s);
} else { } else {
@@ -933,7 +934,7 @@ namespace proc {
if (config::input.enable_input_only_mode) { if (config::input.enable_input_only_mode) {
proc::ctx_t ctx; proc::ctx_t ctx;
// ctx.uuid = ""; // We're not using uuid for this special entry // ctx.uuid = ""; // We're not using uuid for this special entry
ctx.name = "Input Only"; ctx.name = "Remote Input";
ctx.image_path = parse_env_val(this_env, "input_only.png"); ctx.image_path = parse_env_val(this_env, "input_only.png");
ctx.virtual_display = false; ctx.virtual_display = false;
ctx.scale_factor = 100; ctx.scale_factor = 100;
@@ -957,7 +958,8 @@ namespace proc {
} }
ids.insert(ctx.id); ids.insert(ctx.id);
input_only_app_id = ctx.id; input_only_app_id_str = ctx.id;
input_only_app_id = util::from_view(ctx.id);
apps.emplace_back(std::move(ctx)); apps.emplace_back(std::move(ctx));
} }
+2 -1
View File
@@ -182,5 +182,6 @@ namespace proc {
terminate_process_group(boost::process::v1::child &proc, boost::process::v1::group &group, std::chrono::seconds exit_timeout); terminate_process_group(boost::process::v1::child &proc, boost::process::v1::group &group, std::chrono::seconds exit_timeout);
extern proc_t proc; extern proc_t proc;
extern std::string input_only_app_id; extern int input_only_app_id;
extern std::string input_only_app_id_str;
} // namespace proc } // namespace proc
Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

After

Width:  |  Height:  |  Size: 99 KiB