diff options
author | Armin Zhu <lisp_25689@163.com> | 2024-01-14 09:45:36 +0100 |
---|---|---|
committer | Daniel Engberg <diizzy@FreeBSD.org> | 2024-01-14 21:35:24 +0100 |
commit | 251a8452de9d0e60e294057899e992ed581077aa (patch) | |
tree | 50afb2b2e440bad855bffda59441cb056b64a819 /games/moonlight-embedded/files/patch-src_main.c | |
parent | print/fontforge: Update to 20230101 (diff) |
games/moonlight-embedded: Update to 2.6.2
In addition to maintainers patch fix REINPLACE_CMD for docs/README.pod
Changelog:
https://github.com/moonlight-stream/moonlight-embedded/releases/tag/v2.6.2
PR: 276144
Diffstat (limited to 'games/moonlight-embedded/files/patch-src_main.c')
-rw-r--r-- | games/moonlight-embedded/files/patch-src_main.c | 64 |
1 files changed, 16 insertions, 48 deletions
diff --git a/games/moonlight-embedded/files/patch-src_main.c b/games/moonlight-embedded/files/patch-src_main.c index 32131dc18e63..827f3a3ade46 100644 --- a/games/moonlight-embedded/files/patch-src_main.c +++ b/games/moonlight-embedded/files/patch-src_main.c @@ -1,4 +1,4 @@ ---- src/main.c.orig 2023-10-11 15:50:11 UTC +--- src/main.c.orig 2023-11-03 06:08:34 UTC +++ src/main.c @@ -42,6 +42,7 @@ #include <client.h> @@ -8,26 +8,17 @@ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> -@@ -52,7 +53,6 @@ +@@ -52,7 +53,8 @@ #include <netinet/in.h> #include <netdb.h> #include <arpa/inet.h> -#include <openssl/rand.h> ++ ++extern void is_use_kbdmux(); static void applist(PSERVER_DATA server) { PAPP_LIST list = NULL; -@@ -149,6 +149,10 @@ static void stream(PSERVER_DATA server, PCONFIGURATION - if (!config->viewonly) - evdev_start(); - loop_main(); -+ #ifdef HAVE_SDL -+ if (!isNoSdl) -+ x11_sdl_stop(); -+ #endif - if (!config->viewonly) - evdev_stop(); - } -@@ -202,7 +206,6 @@ static void help() { +@@ -202,7 +204,6 @@ static void help() { printf("\t-bitrate <bitrate>\tSpecify the bitrate in Kbps\n"); printf("\t-packetsize <size>\tSpecify the maximum packetsize in bytes\n"); printf("\t-codec <codec>\t\tSelect used codec: auto/h264/h265/av1 (default auto)\n"); @@ -35,19 +26,7 @@ printf("\t-remote <yes/no/auto>\t\t\tEnable optimizations for WAN streaming (default auto)\n"); printf("\t-app <app>\t\tName of app to stream\n"); printf("\t-nosops\t\t\tDon't allow GFE to modify game settings\n"); -@@ -238,7 +241,10 @@ static void pair_check(PSERVER_DATA server) { - int main(int argc, char* argv[]) { - CONFIGURATION config; - config_parse(argc, argv, &config); -- -+ #ifndef HAVE_SDL -+ isNoSdl = true; -+ #endif -+ - if (config.action == NULL || strcmp("help", config.action) == 0) - help(); - -@@ -322,19 +328,19 @@ int main(int argc, char* argv[]) { +@@ -322,19 +323,19 @@ int main(int argc, char* argv[]) { config.stream.supportedVideoFormats = VIDEO_FORMAT_H264; if (config.codec == CODEC_HEVC || (config.codec == CODEC_UNSPECIFIED && platform_prefers_codec(system, CODEC_HEVC))) { config.stream.supportedVideoFormats |= VIDEO_FORMAT_H265; @@ -75,27 +54,16 @@ #ifdef HAVE_SDL if (system == SDL) -@@ -371,7 +377,19 @@ int main(int argc, char* argv[]) { +@@ -362,6 +363,8 @@ int main(int argc, char* argv[]) { + mappings = map; + } - udev_init(!inputAdded, mappings, config.debug_level > 0, config.rotate); - evdev_init(config.mouse_emulation); -+ #ifdef HAVE_SDL -+ if (isNoSdl) -+ rumble_handler = evdev_rumble; -+ else { -+ x11_sdl_init(config.mapping); -+ rumble_handler = sdlinput_rumble; -+ rumble_triggers_handler = sdlinput_rumble_triggers; -+ set_motion_event_state_handler = sdlinput_set_motion_event_state; -+ set_controller_led_handler = sdlinput_set_controller_led; -+ } -+ #else - rumble_handler = evdev_rumble; -+ #endif - #ifdef HAVE_LIBCEC - cec_init(); - #endif /* HAVE_LIBCEC */ -@@ -398,7 +416,8 @@ int main(int argc, char* argv[]) { ++ // test is use kbdmux driver ++ is_use_kbdmux(); + for (int i=0;i<config.inputsCount;i++) { + if (config.debug_level > 0) + printf("Adding input device %s...\n", config.inputs[i]); +@@ -398,7 +401,8 @@ int main(int argc, char* argv[]) { if (config.pin > 0 && config.pin <= 9999) { sprintf(pin, "%04d", config.pin); } else { @@ -105,7 +73,7 @@ } printf("Please enter the following PIN on the target PC: %s\n", pin); fflush(stdout); -@@ -406,6 +425,7 @@ int main(int argc, char* argv[]) { +@@ -406,6 +410,7 @@ int main(int argc, char* argv[]) { fprintf(stderr, "Failed to pair to server: %s\n", gs_error); } else { printf("Succesfully paired\n"); |