View | Details | Raw Unified | Return to bug 274026 | Differences between
and this patch

Collapse All | Expand All

(-)b/Makefile (-12 / +4 lines)
Lines 1-12 Link Here
1
PORTNAME=	moonlight-embedded
1
PORTNAME=	moonlight-embedded
2
DISTVERSION=	2.5.3
2
DISTVERSION=	2.6.0
3
PORTREVISION=	2
4
CATEGORIES=	games
3
CATEGORIES=	games
5
MASTER_SITES=	https://github.com/irtimmer/moonlight-embedded/releases/download/v${DISTVERSION}/
4
MASTER_SITES=	https://github.com/moonlight-stream/moonlight-embedded/releases/download/v${DISTVERSION}/
6
5
7
MAINTAINER=	ports@FreeBSD.org
6
MAINTAINER=	lisp_25689@163.com
8
COMMENT=	Gamestream client
7
COMMENT=	Gamestream client
9
WWW=		https://github.com/irtimmer/moonlight-embedded
8
WWW=		https://github.com/moonlight-stream/moonlight-embedded
10
9
11
LICENSE=	GPLv3+
10
LICENSE=	GPLv3+
12
LICENSE_FILE=	${WRKSRC}/LICENSE
11
LICENSE_FILE=	${WRKSRC}/LICENSE
Lines 32-44 CFLAGS+= -DHAS_SOCKLEN_T=1 -I${LOCALBASE}/include/libepoll-shim/ Link Here
32
LDFLAGS+=	-lepoll-shim
31
LDFLAGS+=	-lepoll-shim
33
32
34
post-patch:
33
post-patch:
35
	@${REINPLACE_CMD} -e '/(ALSA)/d' \
36
		-e '/libpulse-simple/d' \
37
		-e '/libcec/d' \
38
		${WRKSRC}/CMakeLists.txt
39
	@${REINPLACE_CMD} -e 's@SHARED@STATIC@' \
40
		-e 's@OpenSSL 1.0.2@OpenSSL@' -e '/^install(/d' \
41
		${WRKSRC}/libgamestream/CMakeLists.txt
42
	@${REINPLACE_CMD} -e 's@/etc/moonlight/moonlight.conf@${PREFIX}/etc/moonlight.conf@' \
34
	@${REINPLACE_CMD} -e 's@/etc/moonlight/moonlight.conf@${PREFIX}/etc/moonlight.conf@' \
43
		-e 's@moonligt@moonlight@g' \
35
		-e 's@moonligt@moonlight@g' \
44
		${WRKSRC}/docs/README.pod
36
		${WRKSRC}/docs/README.pod
(-)b/files/patch-CMakeLists.txt (+45 lines)
Added Link Here
1
--- CMakeLists.txt.orig	2023-09-23 11:06:25.469619000 +0800
2
+++ CMakeLists.txt	2023-09-23 10:58:02.167754000 +0800
3
@@ -5,14 +5,11 @@
4
 include(${CMAKE_ROOT}/Modules/GNUInstallDirs.cmake)
5
 include(${CMAKE_SOURCE_DIR}/cmake/generate_version_header.cmake)
6
 
7
-add_compile_options(-Wall -Wextra -Wno-unused-parameter -Wno-pointer-sign -Wno-sign-compare -Wno-switch)
8
-
9
 aux_source_directory(./src SRC_LIST)
10
 list(APPEND SRC_LIST ./src/input/evdev.c ./src/input/mapping.c ./src/input/udev.c)
11
 
12
 set(MOONLIGHT_DEFINITIONS)
13
 
14
-find_package(ALSA)
15
 find_package(Opus REQUIRED)
16
 find_package(Broadcom-OMX)
17
 find_package(Freescale)
18
@@ -46,10 +43,8 @@
19
   endif()
20
 endif()
21
 if (ENABLE_PULSE)
22
-  pkg_check_modules(PULSE libpulse-simple)
23
 endif()
24
 if (ENABLE_CEC)
25
-  pkg_check_modules(CEC libcec>=4)
26
 endif()
27
 
28
 pkg_check_modules(MMAL mmal)
29
@@ -91,7 +86,6 @@
30
   list(APPEND MOONLIGHT_DEFINITIONS HAVE_LIBCEC)
31
   list(APPEND MOONLIGHT_OPTIONS CEC)
32
   target_sources(moonlight PRIVATE ./src/input/cec.c)
33
-  target_include_directories(moonlight PRIVATE ./third_party/libcec ${CEC_INCLUDE_DIRS})
34
   target_link_libraries(moonlight ${CEC_LIBRARIES})
35
 endif()
36
 
37
@@ -158,7 +152,7 @@
38
   if(X11_FOUND)
39
     list(APPEND MOONLIGHT_DEFINITIONS HAVE_X11)
40
     list(APPEND MOONLIGHT_OPTIONS X11)
41
-    target_sources(moonlight PRIVATE ./src/video/x11.c ./src/video/egl.c ./src/input/x11.c)
42
+    target_sources(moonlight PRIVATE ./src/video/x11.c ./src/video/egl.c ./src/input/x11.c ./src/audio/oss.c)
43
     target_include_directories(moonlight PRIVATE ${XLIB_INCLUDE_DIRS} ${EGL_INCLUDE_DIRS} ${GLES_INCLUDE_DIRS})
44
     target_link_libraries(moonlight ${XLIB_LIBRARIES} ${EGL_LIBRARIES} ${GLES_LIBRARIES})
45
   endif()
(-)b/files/patch-libgamestream_CMakeLists.txt (+29 lines)
Added Link Here
1
--- libgamestream/CMakeLists.txt.orig	2023-09-23 11:06:37.823565000 +0800
2
+++ libgamestream/CMakeLists.txt	2023-09-23 10:59:20.178791000 +0800
3
@@ -3,7 +3,7 @@
4
 find_package(LibUUID REQUIRED)
5
 find_package(Threads REQUIRED)
6
 find_package(CURL REQUIRED)
7
-find_package(OpenSSL 1.0.2 REQUIRED)
8
+find_package(OpenSSL REQUIRED)
9
 find_package(EXPAT REQUIRED)
10
 
11
 pkg_check_modules(AVAHI REQUIRED avahi-client)
12
@@ -15,9 +15,9 @@
13
 aux_source_directory(../third_party/moonlight-common-c/src MOONLIGHT_COMMON_SRC_LIST)
14
 aux_source_directory(../third_party/moonlight-common-c/reedsolomon MOONLIGHT_COMMON_SRC_LIST)
15
 
16
-add_library(moonlight-common SHARED ${MOONLIGHT_COMMON_SRC_LIST})
17
+add_library(moonlight-common STATIC ${MOONLIGHT_COMMON_SRC_LIST})
18
 
19
-add_library(gamestream SHARED ${GAMESTREAM_SRC_LIST})
20
+add_library(gamestream STATIC ${GAMESTREAM_SRC_LIST})
21
 target_link_libraries(gamestream moonlight-common)
22
 
23
 set_target_properties(gamestream PROPERTIES SOVERSION ${SO_VERSION} VERSION ${PROJECT_VERSION})
24
@@ -28,5 +28,3 @@
25
 target_link_libraries(gamestream ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${EXPAT_LIBRARIES} ${AVAHI_LIBRARIES} ${LIBUUID_LIBRARIES})
26
 
27
 target_link_libraries(gamestream ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS})
28
-
29
-install(TARGETS gamestream moonlight-common DESTINATION ${CMAKE_INSTALL_LIBDIR})
(-)b/files/patch-libgamestream_client.c (-5 / +5 lines)
Lines 1-7 Link Here
1
--- libgamestream/client.c.orig	2018-08-11 15:43:13 UTC
1
--- libgamestream/client.c.orig	2023-09-21 13:24:56.778585000 +0800
2
+++ libgamestream/client.c
2
+++ libgamestream/client.c	2023-09-21 13:17:44.126595000 +0800
3
@@ -505,7 +505,11 @@ int gs_pair(PSERVER_DATA server, char* pin) {
3
@@ -537,7 +537,11 @@
4
   RAND_bytes(client_secret_data, 16);
4
   RAND_bytes(client_secret_data, sizeof(client_secret_data));
5
 
5
 
6
   const ASN1_BIT_STRING *asnSignature;
6
   const ASN1_BIT_STRING *asnSignature;
7
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
7
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
Lines 10-14 Link Here
10
+  asnSignature = cert->signature;
10
+  asnSignature = cert->signature;
11
+#endif
11
+#endif
12
 
12
 
13
   char challenge_response[16 + 256 + 16];
13
   char challenge_response[16 + SIGNATURE_LEN + sizeof(client_secret_data)];
14
   char challenge_response_hash[32];
14
   char challenge_response_hash[32];
(-)b/files/patch-libgamestream_http.c (+12 lines)
Added Link Here
1
--- libgamestream/http.c.orig	2023-09-21 13:24:50.907143000 +0800
2
+++ libgamestream/http.c	2023-09-21 13:17:44.126971000 +0800
3
@@ -73,6 +73,9 @@
4
 int http_request(char* url, PHTTP_DATA data) {
5
   curl_easy_setopt(curl, CURLOPT_WRITEDATA, data);
6
   curl_easy_setopt(curl, CURLOPT_URL, url);
7
+  curl_easy_setopt(curl, CURLOPT_TCP_FASTOPEN, 1L);
8
+  curl_easy_setopt(curl, CURLOPT_FRESH_CONNECT, 1);
9
+  curl_easy_setopt(curl, CURLOPT_FORBID_REUSE, 1);
10
 
11
   if (debug)
12
     printf("Request %s\n", url);
(-)b/files/patch-src_input_evdev.c (-6 / +107 lines)
Lines 1-6 Link Here
1
--- src/input/evdev.c.orig	2021-12-20 00:24:48 UTC
1
--- src/input/evdev.c.orig	2023-09-22 13:23:15.263067000 +0800
2
+++ src/input/evdev.c
2
+++ src/input/evdev.c	2023-09-22 13:23:26.674639000 +0800
3
@@ -38,10 +38,10 @@
3
@@ -38,10 +38,13 @@
4
 #include <limits.h>
4
 #include <limits.h>
5
 #include <unistd.h>
5
 #include <unistd.h>
6
 #include <pthread.h>
6
 #include <pthread.h>
Lines 9-26 Link Here
9
 #include <math.h>
9
 #include <math.h>
10
 
10
 
11
-#if __BYTE_ORDER == __LITTLE_ENDIAN
11
-#if __BYTE_ORDER == __LITTLE_ENDIAN
12
+extern bool isNoSdl;
13
+bool iskeyboardgrab = true;
14
+
12
+#if _BYTE_ORDER == _LITTLE_ENDIAN
15
+#if _BYTE_ORDER == _LITTLE_ENDIAN
13
 #define int16_to_le(val) val
16
 #define int16_to_le(val) val
14
 #else
17
 #else
15
 #define int16_to_le(val) ((((val) >> 8) & 0x00FF) | (((val) << 8) & 0xFF00))
18
 #define int16_to_le(val) ((((val) >> 8) & 0x00FF) | (((val) << 8) & 0xFF00))
16
@@ -66,8 +66,8 @@ struct input_device {
19
@@ -66,8 +69,8 @@
17
   int hats_state[3][2];
20
   int hats_state[3][2];
18
   int fd;
21
   int fd;
19
   char modifiers;
22
   char modifiers;
20
-  __s32 mouseDeltaX, mouseDeltaY, mouseScroll;
23
-  __s32 mouseDeltaX, mouseDeltaY, mouseVScroll, mouseHScroll;
21
-  __s32 touchDownX, touchDownY, touchX, touchY;
24
-  __s32 touchDownX, touchDownY, touchX, touchY;
22
+  int32_t mouseDeltaX, mouseDeltaY, mouseScroll;
25
+  int32_t mouseDeltaX, mouseDeltaY, mouseVScroll, mouseHScroll;
23
+  int32_t touchDownX, touchDownY, touchX, touchY;
26
+  int32_t touchDownX, touchDownY, touchX, touchY;
24
   struct timeval touchDownTime;
27
   struct timeval touchDownTime;
25
   struct timeval btnDownTime;
28
   struct timeval btnDownTime;
26
   short controllerId;
29
   short controllerId;
30
@@ -127,6 +130,7 @@
31
 
32
 #define ACTION_MODIFIERS (MODIFIER_SHIFT|MODIFIER_ALT|MODIFIER_CTRL)
33
 #define QUIT_KEY KEY_Q
34
+#define UNGRAB_KEY KEY_G
35
 #define QUIT_BUTTONS (PLAY_FLAG|BACK_FLAG|LB_FLAG|RB_FLAG)
36
 
37
 static bool (*handler) (struct input_event*, struct input_device*);
38
@@ -247,8 +251,8 @@
39
     deltaY = pow((float)rawY / 32767.0f * MOUSE_EMULATION_MOTION_MULTIPLIER, 3);
40
 
41
     // Enforce deadzones
42
-    deltaX = fabs(deltaX) > MOUSE_EMULATION_DEADZONE ? deltaX - MOUSE_EMULATION_DEADZONE : 0;
43
-    deltaY = fabs(deltaY) > MOUSE_EMULATION_DEADZONE ? deltaY - MOUSE_EMULATION_DEADZONE : 0;
44
+    deltaX = abs(deltaX) > MOUSE_EMULATION_DEADZONE ? deltaX - MOUSE_EMULATION_DEADZONE : 0;
45
+    deltaY = abs(deltaY) > MOUSE_EMULATION_DEADZONE ? deltaY - MOUSE_EMULATION_DEADZONE : 0;
46
 
47
     if (deltaX != 0 || deltaY != 0)
48
       LiSendMouseMoveEvent(deltaX, -deltaY);
49
@@ -343,7 +347,7 @@
50
     if (dev->mouseHScroll != 0) {
51
       LiSendHScrollEvent(dev->mouseHScroll);
52
       dev->mouseHScroll = 0;
53
-    }
54
+    } 
55
     if (dev->gamepadModified) {
56
       if (dev->controllerId < 0) {
57
         for (int i = 0; i < MAX_GAMEPADS; i++) {
58
@@ -404,6 +408,10 @@
59
         return true;
60
       } else if (waitingToExitOnModifiersUp && dev->modifiers == 0)
61
         return false;
62
+      if ((dev->modifiers & ACTION_MODIFIERS) == ACTION_MODIFIERS &&
63
+          ev->code == UNGRAB_KEY && ev->value != 0) {
64
+        grab_keyboard();
65
+      }
66
 
67
       short code = 0x80 << 8 | keyCodes[ev->code];
68
       LiSendKeyboardEvent(code, ev->value?KEY_ACTION_DOWN:KEY_ACTION_UP, dev->modifiers);
69
@@ -813,7 +821,7 @@
70
   if (mappings == NULL && strstr(name, "Xbox 360 Wireless Receiver") != NULL)
71
     mappings = xwc_mapping;
72
 
73
-  bool is_keyboard = libevdev_has_event_code(evdev, EV_KEY, KEY_Q);
74
+  bool is_keyboard = libevdev_has_event_code(evdev, EV_KEY, KEY_Q) && libevdev_get_id_version(evdev) < 500;
75
   bool is_mouse = libevdev_has_event_type(evdev, EV_REL) || libevdev_has_event_code(evdev, EV_KEY, BTN_LEFT);
76
   bool is_touchscreen = libevdev_has_event_code(evdev, EV_KEY, BTN_TOUCH);
77
 
78
@@ -850,6 +858,12 @@
79
   }
80
 
81
   if (is_gamepad) {
82
+    // stop to using SDL,test if break is better
83
+    if (!isNoSdl) {
84
+      libevdev_free(evdev);
85
+      close(fd);
86
+      return;
87
+    }
88
     evdev_gamepads++;
89
 
90
     if (mappings == NULL) {
91
@@ -1055,9 +1069,13 @@
92
   // we're ready to take input events. Ctrl+C works up until
93
   // this point.
94
   for (int i = 0; i < numDevices; i++) {
95
-    if ((devices[i].is_keyboard || devices[i].is_mouse || devices[i].is_touchscreen) && ioctl(devices[i].fd, EVIOCGRAB, 1) < 0) {
96
+    if ((devices[i].is_mouse || devices[i].is_touchscreen) && ioctl(devices[i].fd, EVIOCGRAB, 1) < 0) {
97
       fprintf(stderr, "EVIOCGRAB failed with error %d\n", errno);
98
     }
99
+    if (devices[i].is_keyboard && libevdev_get_id_bustype(devices[i].dev) > 3) {
100
+      if (ioctl(devices[i].fd, EVIOCGRAB, 1) < 0)
101
+        fprintf(stderr, "EVIOCGRAB failed with error %d\n", errno);
102
+    }
103
   }
104
 
105
   // Any new input devices detected after this point will be grabbed immediately
106
@@ -1111,4 +1129,21 @@
107
   event.value = 1;
108
   write(device->fd, (const void*) &event, sizeof(event));
109
   device->haptic_effect_id = effect.id;
110
+}
111
+
112
+void grab_keyboard() {
113
+  int grabnum;
114
+  if (iskeyboardgrab) {
115
+    grabnum = 0;
116
+    iskeyboardgrab = false;
117
+  } else {
118
+    grabnum = 1;
119
+    iskeyboardgrab = true;
120
+  }
121
+  for (int i = 0; i < numDevices; i++) {
122
+    if (devices[i].is_keyboard && libevdev_get_id_bustype(devices[i].dev) > 3) {
123
+      if (ioctl(devices[i].fd, EVIOCGRAB, grabnum) < 0)
124
+        fprintf(stderr, "EVIOCGRAB failed with error %d\n", errno);
125
+    }
126
+  }
127
 }
(-)b/files/patch-src_main.c (+136 lines)
Added Link Here
1
--- src/main.c.orig	2023-09-21 13:25:05.298839000 +0800
2
+++ src/main.c	2023-09-21 13:17:44.207870000 +0800
3
@@ -23,6 +23,7 @@
4
 #include "platform.h"
5
 #include "config.h"
6
 #include "sdl.h"
7
+#include "x11_sdl.h"
8
 
9
 #include "audio/audio.h"
10
 #include "video/video.h"
11
@@ -42,6 +43,7 @@
12
 #include <client.h>
13
 #include <discover.h>
14
 
15
+#include <time.h>
16
 #include <stdio.h>
17
 #include <stdlib.h>
18
 #include <stdbool.h>
19
@@ -52,7 +54,6 @@
20
 #include <netinet/in.h>
21
 #include <netdb.h>
22
 #include <arpa/inet.h>
23
-#include <openssl/rand.h>
24
 
25
 static void applist(PSERVER_DATA server) {
26
   PAPP_LIST list = NULL;
27
@@ -139,8 +140,11 @@
28
     connection_debug = true;
29
   }
30
 
31
-  if (IS_EMBEDDED(system))
32
+  if (IS_EMBEDDED(system)) {
33
     loop_init();
34
+    if (!isNoSdl)
35
+      x11_sdl_init();
36
+  }
37
 
38
   platform_start(system);
39
   LiStartConnection(&server->serverInfo, &config->stream, &connection_callbacks, platform_get_video(system), platform_get_audio(system, config->audio_device), NULL, drFlags, config->audio_device, 0);
40
@@ -148,7 +152,10 @@
41
   if (IS_EMBEDDED(system)) {
42
     if (!config->viewonly)
43
       evdev_start();
44
-    loop_main();
45
+    if (!isNoSdl)
46
+      x11_sdl_loop_main(config->stream.width, config->stream.height);
47
+    else
48
+      loop_main();
49
     if (!config->viewonly)
50
       evdev_stop();
51
   }
52
@@ -202,7 +209,6 @@
53
   printf("\t-bitrate <bitrate>\tSpecify the bitrate in Kbps\n");
54
   printf("\t-packetsize <size>\tSpecify the maximum packetsize in bytes\n");
55
   printf("\t-codec <codec>\t\tSelect used codec: auto/h264/h265/av1 (default auto)\n");
56
-  printf("\t-hdr\t\tEnable HDR streaming (experimental, requires host and device support)\n");
57
   printf("\t-remote <yes/no/auto>\t\t\tEnable optimizations for WAN streaming (default auto)\n");
58
   printf("\t-app <app>\t\tName of app to stream\n");
59
   printf("\t-nosops\t\t\tDon't allow GFE to modify game settings\n");
60
@@ -251,8 +257,10 @@
61
       exit(-1);
62
     }
63
 
64
-    evdev_create(config.inputs[0], NULL, config.debug_level > 0, config.rotate);
65
-    evdev_map(config.inputs[0]);
66
+    if (isNoSdl) {
67
+      evdev_create(config.inputs[0], NULL, config.debug_level > 0, config.rotate);
68
+      evdev_map(config.inputs[0]);    
69
+    }
70
     exit(0);
71
   }
72
 
73
@@ -300,7 +308,7 @@
74
   if (config.debug_level > 0) {
75
     printf("GPU: %s, GFE: %s (%s, %s)\n", server.gpuType, server.serverInfo.serverInfoGfeVersion, server.gsVersion, server.serverInfo.serverInfoAppVersion);
76
     printf("Server codec flags: 0x%x\n", server.serverInfo.serverCodecModeSupport);
77
-  }
78
+  }    
79
 
80
   if (strcmp("list", config.action) == 0) {
81
     pair_check(&server);
82
@@ -322,19 +330,19 @@
83
     config.stream.supportedVideoFormats = VIDEO_FORMAT_H264;
84
     if (config.codec == CODEC_HEVC || (config.codec == CODEC_UNSPECIFIED && platform_prefers_codec(system, CODEC_HEVC))) {
85
       config.stream.supportedVideoFormats |= VIDEO_FORMAT_H265;
86
-      if (config.hdr)
87
-        config.stream.supportedVideoFormats |= VIDEO_FORMAT_H265_MAIN10;
88
+      //if (config.hdr)
89
+      //  config.stream.supportedVideoFormats |= VIDEO_FORMAT_H265_MAIN10;
90
     }
91
     if (config.codec == CODEC_AV1 || (config.codec == CODEC_UNSPECIFIED && platform_prefers_codec(system, CODEC_AV1))) {
92
       config.stream.supportedVideoFormats |= VIDEO_FORMAT_AV1_MAIN8;
93
-      if (config.hdr)
94
-        config.stream.supportedVideoFormats |= VIDEO_FORMAT_AV1_MAIN10;
95
+      //if (config.hdr)
96
+      //  config.stream.supportedVideoFormats |= VIDEO_FORMAT_AV1_MAIN10;
97
     }
98
 
99
-    if (config.hdr && !(config.stream.supportedVideoFormats & VIDEO_FORMAT_MASK_10BIT)) {
100
-      fprintf(stderr, "HDR streaming requires HEVC or AV1 codec\n");
101
-      exit(-1);
102
-    }
103
+    //if (config.hdr && !(config.stream.supportedVideoFormats & VIDEO_FORMAT_MASK_10BIT)) {
104
+    //  fprintf(stderr, "HDR streaming requires HEVC or AV1 codec\n");
105
+    //  exit(-1);
106
+    //}    
107
 
108
     #ifdef HAVE_SDL
109
     if (system == SDL)
110
@@ -371,7 +379,15 @@
111
 
112
         udev_init(!inputAdded, mappings, config.debug_level > 0, config.rotate);
113
         evdev_init(config.mouse_emulation);
114
-        rumble_handler = evdev_rumble;
115
+        if (isNoSdl)
116
+          rumble_handler = evdev_rumble;
117
+        else {
118
+          sdlinput_init(config.mapping);
119
+          rumble_handler = sdlinput_rumble;
120
+          rumble_triggers_handler = sdlinput_rumble_triggers;
121
+          set_motion_event_state_handler = sdlinput_set_motion_event_state;
122
+          set_controller_led_handler = sdlinput_set_controller_led;
123
+        }
124
         #ifdef HAVE_LIBCEC
125
         cec_init();
126
         #endif /* HAVE_LIBCEC */
127
@@ -398,7 +414,8 @@
128
     if (config.pin > 0 && config.pin <= 9999) {
129
       sprintf(pin, "%04d", config.pin);
130
     } else {
131
-      sprintf(pin, "%d%d%d%d", (unsigned)random() % 10, (unsigned)random() % 10, (unsigned)random() % 10, (unsigned)random() % 10);
132
+      srand((unsigned)time(NULL));
133
+      sprintf(pin, "%04d", (unsigned)rand() % 9999 + 1);
134
     }
135
     printf("Please enter the following PIN on the target PC: %s\n", pin);
136
     fflush(stdout);
(-)b/files/patch-src_platform.c (-5 / +71 lines)
Lines 1-10 Link Here
1
--- src/platform.c.orig	2021-12-20 00:24:48 UTC
1
--- src/platform.c.orig	2023-09-21 13:30:28.000000000 +0800
2
+++ src/platform.c
2
+++ src/platform.c	2023-09-21 21:30:20.507461000 +0800
3
@@ -188,14 +188,6 @@ AUDIO_RENDERER_CALLBACKS* platform_get_audio(enum plat
3
@@ -77,8 +77,8 @@
4
       return (PAUDIO_RENDERER_CALLBACKS) dlsym(RTLD_DEFAULT, "audio_callbacks_omx");
4
   bool x11 = strcmp(name, "x11") == 0;
5
   bool vdpau = strcmp(name, "x11_vdpau") == 0;
6
   bool vaapi = strcmp(name, "x11_vaapi") == 0;
7
-  if (std || x11 || vdpau || vaapi) {
8
-    int init = x11_init(std || vdpau, std || vaapi);
9
+  if (x11 || vdpau || vaapi) {
10
+    int init = x11_init(vdpau, vaapi);
11
     #ifdef HAVE_VAAPI
12
     if (init == INIT_VAAPI)
13
       return X11_VAAPI;
14
@@ -87,18 +87,13 @@
15
     if (init == INIT_VDPAU)
16
       return X11_VDPAU;
17
     #endif
18
-    #ifdef HAVE_SDL
19
-    return SDL;
20
-    #else
21
     return X11;
22
-    #endif
23
   }
24
   #endif
25
   #ifdef HAVE_SDL
26
   if (std || strcmp(name, "sdl") == 0)
27
     return SDL;
28
   #endif
29
-
30
   if (strcmp(name, "fake") == 0)
31
     return FAKE;
32
 
33
@@ -109,14 +104,14 @@
34
   switch (system) {
35
   #ifdef HAVE_AML
36
   case AML:
37
-    write_bool("/sys/class/graphics/fb0/blank", true);
38
-    write_bool("/sys/class/graphics/fb1/blank", true);
39
-    write_bool("/sys/class/video/disable_video", false);
40
+    blank_fb("/sys/class/graphics/fb0/blank", true);
41
+    blank_fb("/sys/class/graphics/fb1/blank", true);
42
+    blank_fb("/sys/class/video/disable_video", false);
43
     break;
44
   #endif
45
   #if defined(HAVE_PI) || defined(HAVE_MMAL)
46
   case PI:
47
-    write_bool("/sys/class/graphics/fb0/blank", true);
48
+    blank_fb("/sys/class/graphics/fb0/blank", true);
49
     break;
50
   #endif
51
   }
52
@@ -126,13 +121,13 @@
53
   switch (system) {
54
   #ifdef HAVE_AML
55
   case AML:
56
-    write_bool("/sys/class/graphics/fb0/blank", false);
57
-    write_bool("/sys/class/graphics/fb1/blank", false);
58
+    blank_fb("/sys/class/graphics/fb0/blank", false);
59
+    blank_fb("/sys/class/graphics/fb1/blank", false);
60
     break;
61
   #endif
62
   #if defined(HAVE_PI) || defined(HAVE_MMAL)
63
   case PI:
64
-    write_bool("/sys/class/graphics/fb0/blank", false);
65
+    blank_fb("/sys/class/graphics/fb0/blank", false);
66
     break;
67
   #endif
68
   }
69
@@ -195,13 +190,7 @@
5
     // fall-through
70
     // fall-through
6
   #endif
71
   #endif
7
-  default:
72
   default:
8
-    #ifdef HAVE_PULSE
73
-    #ifdef HAVE_PULSE
9
-    if (audio_pulse_init(audio_device))
74
-    if (audio_pulse_init(audio_device))
10
-      return &audio_callbacks_pulse;
75
-      return &audio_callbacks_pulse;
Lines 12-17 Link Here
12
-    #ifdef HAVE_ALSA
77
-    #ifdef HAVE_ALSA
13
-    return &audio_callbacks_alsa;
78
-    return &audio_callbacks_alsa;
14
-    #endif
79
-    #endif
80
+      return &audio_callbacks_oss;
15
   }
81
   }
16
   return NULL;
82
   return NULL;
17
 }
83
 }
(-)b/files/patch-third_party_moonlight-common-c_enet_CMakeLists.txt (+14 lines)
Added Link Here
1
--- third_party/moonlight-common-c/enet/CMakeLists.txt.orig	2023-09-23 11:07:11.889821000 +0800
2
+++ third_party/moonlight-common-c/enet/CMakeLists.txt	2023-09-23 11:00:03.239329000 +0800
3
@@ -107,11 +107,3 @@
4
 if (MINGW)
5
     target_link_libraries(enet winmm ws2_32)
6
 endif()
7
-
8
-install(TARGETS enet
9
-    RUNTIME DESTINATION bin
10
-    ARCHIVE DESTINATION lib/static
11
-    LIBRARY DESTINATION lib)
12
-
13
-install(DIRECTORY include/
14
-        DESTINATION include)
(-)b/pkg-descr (-2 / +5 lines)
Lines 3-5 GameStream, as used by the NVIDIA Shield. Link Here
3
3
4
Moonlight Embedded allows you to stream your full collection of games
4
Moonlight Embedded allows you to stream your full collection of games
5
from your powerful Windows desktop to your FreeBSD system.
5
from your powerful Windows desktop to your FreeBSD system.
6
- 
6
7
--
7
First, pair: # moonlight pair 192.168.0.1
8
Then, connect: # moonlight stream -app Desktop -1080 192.168.0.1
9
10
ENJOY!
8
distinfo | 6 +++---
11
distinfo | 6 +++---
9
1 file changed, 3 insertions(+), 3 deletions(-)
12
1 file changed, 3 insertions(+), 3 deletions(-)
(-)b/distinfo (-5 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1666188557
1
TIMESTAMP = 1695360586
2
SHA256 (moonlight-embedded-2.5.3.tar.xz) = 2fcd00049f58b0af882f0eec7077013c062bc35c8705f3d6bb7949d44e98fac0
2
SHA256 (moonlight-embedded-2.6.0.tar.xz) = 94af6202a7b88e12836f818481b5e68220b353ff4fa0ac65411da16f846f1b19
3
SIZE (moonlight-embedded-2.5.3.tar.xz) = 303180
3
SIZE (moonlight-embedded-2.6.0.tar.xz) = 324996
4
- 
5
--
6
files/patch-src_main.c | 23 ++++++++++-------------
4
files/patch-src_main.c | 23 ++++++++++-------------
7
1 file changed, 10 insertions(+), 13 deletions(-)
5
1 file changed, 10 insertions(+), 13 deletions(-)
(-)b/files/patch-src_main.c (-14 / +10 lines)
Lines 1-5 Link Here
1
--- src/main.c.orig	2023-09-21 13:25:05.298839000 +0800
1
--- src/main.c.orig	2023-09-23 11:55:17.644668000 +0800
2
+++ src/main.c	2023-09-21 13:17:44.207870000 +0800
2
+++ src/main.c	2023-09-23 11:56:37.183181000 +0800
3
@@ -23,6 +23,7 @@
3
@@ -23,6 +23,7 @@
4
 #include "platform.h"
4
 #include "platform.h"
5
 #include "config.h"
5
 #include "config.h"
Lines 57-76 Link Here
57
   printf("\t-remote <yes/no/auto>\t\t\tEnable optimizations for WAN streaming (default auto)\n");
57
   printf("\t-remote <yes/no/auto>\t\t\tEnable optimizations for WAN streaming (default auto)\n");
58
   printf("\t-app <app>\t\tName of app to stream\n");
58
   printf("\t-app <app>\t\tName of app to stream\n");
59
   printf("\t-nosops\t\t\tDon't allow GFE to modify game settings\n");
59
   printf("\t-nosops\t\t\tDon't allow GFE to modify game settings\n");
60
@@ -251,8 +257,10 @@
60
@@ -252,7 +258,8 @@
61
       exit(-1);
62
     }
61
     }
63
 
62
 
64
-    evdev_create(config.inputs[0], NULL, config.debug_level > 0, config.rotate);
63
     evdev_create(config.inputs[0], NULL, config.debug_level > 0, config.rotate);
65
-    evdev_map(config.inputs[0]);
64
-    evdev_map(config.inputs[0]);
66
+    if (isNoSdl) {
65
+    evdev_map(config.inputs[0]);    
67
+      evdev_create(config.inputs[0], NULL, config.debug_level > 0, config.rotate);
66
+
68
+      evdev_map(config.inputs[0]);    
69
+    }
70
     exit(0);
67
     exit(0);
71
   }
68
   }
72
 
69
 
73
@@ -300,7 +308,7 @@
70
@@ -300,7 +307,7 @@
74
   if (config.debug_level > 0) {
71
   if (config.debug_level > 0) {
75
     printf("GPU: %s, GFE: %s (%s, %s)\n", server.gpuType, server.serverInfo.serverInfoGfeVersion, server.gsVersion, server.serverInfo.serverInfoAppVersion);
72
     printf("GPU: %s, GFE: %s (%s, %s)\n", server.gpuType, server.serverInfo.serverInfoGfeVersion, server.gsVersion, server.serverInfo.serverInfoAppVersion);
76
     printf("Server codec flags: 0x%x\n", server.serverInfo.serverCodecModeSupport);
73
     printf("Server codec flags: 0x%x\n", server.serverInfo.serverCodecModeSupport);
Lines 79-85 Link Here
79
 
76
 
80
   if (strcmp("list", config.action) == 0) {
77
   if (strcmp("list", config.action) == 0) {
81
     pair_check(&server);
78
     pair_check(&server);
82
@@ -322,19 +330,19 @@
79
@@ -322,19 +329,19 @@
83
     config.stream.supportedVideoFormats = VIDEO_FORMAT_H264;
80
     config.stream.supportedVideoFormats = VIDEO_FORMAT_H264;
84
     if (config.codec == CODEC_HEVC || (config.codec == CODEC_UNSPECIFIED && platform_prefers_codec(system, CODEC_HEVC))) {
81
     if (config.codec == CODEC_HEVC || (config.codec == CODEC_UNSPECIFIED && platform_prefers_codec(system, CODEC_HEVC))) {
85
       config.stream.supportedVideoFormats |= VIDEO_FORMAT_H265;
82
       config.stream.supportedVideoFormats |= VIDEO_FORMAT_H265;
Lines 107-113 Link Here
107
 
104
 
108
     #ifdef HAVE_SDL
105
     #ifdef HAVE_SDL
109
     if (system == SDL)
106
     if (system == SDL)
110
@@ -371,7 +379,15 @@
107
@@ -371,7 +378,15 @@
111
 
108
 
112
         udev_init(!inputAdded, mappings, config.debug_level > 0, config.rotate);
109
         udev_init(!inputAdded, mappings, config.debug_level > 0, config.rotate);
113
         evdev_init(config.mouse_emulation);
110
         evdev_init(config.mouse_emulation);
Lines 124-130 Link Here
124
         #ifdef HAVE_LIBCEC
121
         #ifdef HAVE_LIBCEC
125
         cec_init();
122
         cec_init();
126
         #endif /* HAVE_LIBCEC */
123
         #endif /* HAVE_LIBCEC */
127
@@ -398,7 +414,8 @@
124
@@ -398,7 +413,8 @@
128
     if (config.pin > 0 && config.pin <= 9999) {
125
     if (config.pin > 0 && config.pin <= 9999) {
129
       sprintf(pin, "%04d", config.pin);
126
       sprintf(pin, "%04d", config.pin);
130
     } else {
127
     } else {
131
- 

Return to bug 274026