mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-06-17 06:11:36 +00:00
Merge remote-tracking branch 'cgutman/gen7fixes'
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ else()
|
|||||||
set(SOFTWARE_FOUND FALSE)
|
set(SOFTWARE_FOUND FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
SET(MOONLIGHT_COMMON_INCLUDE_DIR ./third_party/moonlight-common-c)
|
SET(MOONLIGHT_COMMON_INCLUDE_DIR ./third_party/moonlight-common-c/src)
|
||||||
SET(GAMESTREAM_INCLUDE_DIR ./libgamestream)
|
SET(GAMESTREAM_INCLUDE_DIR ./libgamestream)
|
||||||
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||||
|
|||||||
@@ -10,8 +10,7 @@ pkg_check_modules(ENET REQUIRED libenet)
|
|||||||
aux_source_directory(./ GAMESTREAM_SRC_LIST)
|
aux_source_directory(./ GAMESTREAM_SRC_LIST)
|
||||||
aux_source_directory(../third_party/h264bitstream GAMESTREAM_SRC_LIST)
|
aux_source_directory(../third_party/h264bitstream GAMESTREAM_SRC_LIST)
|
||||||
|
|
||||||
aux_source_directory(../third_party/moonlight-common-c/limelight-common MOONLIGHT_COMMON_SRC_LIST)
|
aux_source_directory(../third_party/moonlight-common-c/src MOONLIGHT_COMMON_SRC_LIST)
|
||||||
aux_source_directory(../third_party/moonlight-common-c/limelight-common/OpenAES MOONLIGHT_COMMON_SRC_LIST)
|
|
||||||
|
|
||||||
add_library(moonlight-common SHARED ${MOONLIGHT_COMMON_SRC_LIST})
|
add_library(moonlight-common SHARED ${MOONLIGHT_COMMON_SRC_LIST})
|
||||||
|
|
||||||
@@ -22,7 +21,7 @@ target_link_libraries(gamestream moonlight-common)
|
|||||||
set_target_properties(gamestream PROPERTIES SOVERSION 0 VERSION ${MOONLIGHT_VERSION})
|
set_target_properties(gamestream PROPERTIES SOVERSION 0 VERSION ${MOONLIGHT_VERSION})
|
||||||
set_target_properties(moonlight-common PROPERTIES SOVERSION 0 VERSION ${MOONLIGHT_VERSION})
|
set_target_properties(moonlight-common PROPERTIES SOVERSION 0 VERSION ${MOONLIGHT_VERSION})
|
||||||
|
|
||||||
target_include_directories(gamestream PRIVATE ../third_party/moonlight-common-c ../third_party/h264bitstream ${AVAHI_INCLUDE_DIRS} ${LIBUUID_INCLUDE_DIRS})
|
target_include_directories(gamestream PRIVATE ../third_party/moonlight-common-c/src ../third_party/h264bitstream ${AVAHI_INCLUDE_DIRS} ${LIBUUID_INCLUDE_DIRS})
|
||||||
target_include_directories(moonlight-common PRIVATE ${ENET_INCLUDE_DIRS})
|
target_include_directories(moonlight-common PRIVATE ${ENET_INCLUDE_DIRS})
|
||||||
target_link_libraries(gamestream ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${EXPAT_LIBRARIES} ${AVAHI_LIBRARIES} ${LIBUUID_LIBRARIES})
|
target_link_libraries(gamestream ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES} ${EXPAT_LIBRARIES} ${AVAHI_LIBRARIES} ${LIBUUID_LIBRARIES})
|
||||||
target_link_libraries(moonlight-common ${ENET_LIBRARIES})
|
target_link_libraries(moonlight-common ${ENET_LIBRARIES})
|
||||||
|
|||||||
+29
-9
@@ -23,7 +23,7 @@
|
|||||||
#include "client.h"
|
#include "client.h"
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
@@ -166,6 +166,16 @@ static int load_cert(const char* keyDirectory) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int load_server_status(PSERVER_DATA server) {
|
static int load_server_status(PSERVER_DATA server) {
|
||||||
|
|
||||||
|
uuid_t uuid;
|
||||||
|
char uuid_str[37];
|
||||||
|
|
||||||
|
int ret;
|
||||||
|
char url[4096];
|
||||||
|
int i;
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
do {
|
||||||
char *pairedText = NULL;
|
char *pairedText = NULL;
|
||||||
char *currentGameText = NULL;
|
char *currentGameText = NULL;
|
||||||
char *versionText = NULL;
|
char *versionText = NULL;
|
||||||
@@ -173,14 +183,17 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
char *heightText = NULL;
|
char *heightText = NULL;
|
||||||
char *serverCodecModeSupportText = NULL;
|
char *serverCodecModeSupportText = NULL;
|
||||||
|
|
||||||
uuid_t uuid;
|
ret = GS_INVALID;
|
||||||
char uuid_str[37];
|
|
||||||
|
|
||||||
int ret = GS_INVALID;
|
|
||||||
char url[4096];
|
|
||||||
uuid_generate_random(uuid);
|
uuid_generate_random(uuid);
|
||||||
uuid_unparse(uuid, uuid_str);
|
uuid_unparse(uuid, uuid_str);
|
||||||
sprintf(url, "https://%s:47984/serverinfo?uniqueid=%s&uuid=%s", server->address, unique_id, uuid_str);
|
|
||||||
|
// Modern GFE versions don't allow serverinfo to be fetched over HTTPS if the client
|
||||||
|
// is not already paired. Since we can't pair without knowing the server version, we
|
||||||
|
// make another request over HTTP if the HTTPS request fails. We can't just use HTTP
|
||||||
|
// for everything because it doesn't accurately tell us if we're paired.
|
||||||
|
sprintf(url, "%s://%s:%d/serverinfo?uniqueid=%s&uuid=%s",
|
||||||
|
i == 0 ? "https" : "http", server->address, i == 0 ? 47984 : 47989, unique_id, uuid_str);
|
||||||
|
|
||||||
PHTTP_DATA data = http_create_data();
|
PHTTP_DATA data = http_create_data();
|
||||||
if (data == NULL) {
|
if (data == NULL) {
|
||||||
@@ -217,6 +230,10 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
if (xml_search(data->memory, data->size, "GfeVersion", &server->gfeVersion) != GS_OK)
|
if (xml_search(data->memory, data->size, "GfeVersion", &server->gfeVersion) != GS_OK)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
// These fields are present on all version of GFE that this client supports
|
||||||
|
if (!strlen(currentGameText) || !strlen(pairedText) || !strlen(versionText) || !strlen(stateText))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
server->paired = pairedText != NULL && strcmp(pairedText, "1") == 0;
|
server->paired = pairedText != NULL && strcmp(pairedText, "1") == 0;
|
||||||
server->currentGame = currentGameText == NULL ? 0 : atoi(currentGameText);
|
server->currentGame = currentGameText == NULL ? 0 : atoi(currentGameText);
|
||||||
server->supports4K = heightText != NULL && serverCodecModeSupportText != NULL && atoi(heightText) >= 2160;
|
server->supports4K = heightText != NULL && serverCodecModeSupportText != NULL && atoi(heightText) >= 2160;
|
||||||
@@ -248,6 +265,9 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
if (serverCodecModeSupportText != NULL)
|
if (serverCodecModeSupportText != NULL)
|
||||||
free(serverCodecModeSupportText);
|
free(serverCodecModeSupportText);
|
||||||
|
|
||||||
|
i++;
|
||||||
|
} while (ret != GS_OK && i < 2);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,7 +581,7 @@ int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, b
|
|||||||
|
|
||||||
srand(time(NULL));
|
srand(time(NULL));
|
||||||
char url[4096];
|
char url[4096];
|
||||||
u_int32_t rikeyid = 1;
|
u_int32_t rikeyid = 0;
|
||||||
char rikey_hex[33];
|
char rikey_hex[33];
|
||||||
bytes_to_hex(config->remoteInputAesKey, rikey_hex, 16);
|
bytes_to_hex(config->remoteInputAesKey, rikey_hex, 16);
|
||||||
|
|
||||||
@@ -583,10 +603,10 @@ int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, b
|
|||||||
else
|
else
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if ((ret = xml_search(data->memory, data->size, "cancel", &result)) != GS_OK)
|
if ((ret = xml_search(data->memory, data->size, "gamesession", &result)) != GS_OK)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (atoi(result) == 0) {
|
if (!strcmp(result, "0")) {
|
||||||
ret = GS_FAILED;
|
ret = GS_FAILED;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "xml.h"
|
#include "xml.h"
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#define GS_SPS_BITSTREAM_FIXUP 0x01
|
#define GS_SPS_BITSTREAM_FIXUP 0x01
|
||||||
#define GS_SPS_BASELINE_HACK 0x02
|
#define GS_SPS_BASELINE_HACK 0x02
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
extern const char* audio_device;
|
extern const char* audio_device;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,6 +17,6 @@
|
|||||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
extern CONNECTION_LISTENER_CALLBACKS connection_callbacks;
|
extern CONNECTION_LISTENER_CALLBACKS connection_callbacks;
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_LIBCEC
|
#ifdef HAVE_LIBCEC
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <ceccloader.h>
|
#include <ceccloader.h>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
#include "mapping.h"
|
#include "mapping.h"
|
||||||
|
|
||||||
#include "libevdev/libevdev.h"
|
#include "libevdev/libevdev.h"
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <libudev.h>
|
#include <libudev.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "sdlinput.h"
|
#include "sdlinput.h"
|
||||||
#include "../sdl.h"
|
#include "../sdl.h"
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#define ACTION_MODIFIERS (MODIFIER_SHIFT|MODIFIER_ALT|MODIFIER_CTRL)
|
#define ACTION_MODIFIERS (MODIFIER_SHIFT|MODIFIER_ALT|MODIFIER_CTRL)
|
||||||
#define QUIT_KEY SDLK_q
|
#define QUIT_KEY SDLK_q
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@
|
|||||||
#include "input/cec.h"
|
#include "input/cec.h"
|
||||||
#include "input/sdlinput.h"
|
#include "input/sdlinput.h"
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "sdl.h"
|
#include "sdl.h"
|
||||||
#include "input/sdlinput.h"
|
#include "input/sdlinput.h"
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
static bool done;
|
static bool done;
|
||||||
static int fullscreen_flags;
|
static int fullscreen_flags;
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@
|
|||||||
#include "ffmpeg_vdpau.h"
|
#include "ffmpeg_vdpau.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <libswscale/swscale.h>
|
#include <libswscale/swscale.h>
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
* along with Moonlight; if not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include "sps.h"
|
#include "sps.h"
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
#include "../sdl.h"
|
#include "../sdl.h"
|
||||||
#include "ffmpeg.h"
|
#include "ffmpeg.h"
|
||||||
|
|
||||||
#include "limelight-common/Limelight.h"
|
#include <Limelight.h>
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_thread.h>
|
#include <SDL_thread.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user