mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-08-17 17:06:10 +00:00
Use --unsupported option also for unsupported resolutions
This commit is contained in:
parent
abbd3766bc
commit
2c35e70cc0
@ -1,4 +1,4 @@
|
|||||||
set(SO_VERSION 1)
|
set(SO_VERSION 2)
|
||||||
|
|
||||||
find_package(LibUUID REQUIRED)
|
find_package(LibUUID REQUIRED)
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
@ -264,7 +264,7 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
i++;
|
i++;
|
||||||
} while (ret != GS_OK && i < 2);
|
} while (ret != GS_OK && i < 2);
|
||||||
|
|
||||||
if (ret == GS_OK) {
|
if (ret == GS_OK && !server->unsupported) {
|
||||||
if (server->serverMajorVersion > MAX_SUPPORTED_GFE_VERSION) {
|
if (server->serverMajorVersion > MAX_SUPPORTED_GFE_VERSION) {
|
||||||
gs_error = "Ensure you're running the latest version of Moonlight Embedded or downgrade GeForce Experience and try again";
|
gs_error = "Ensure you're running the latest version of Moonlight Embedded or downgrade GeForce Experience and try again";
|
||||||
ret = GS_UNSUPPORTED_VERSION;
|
ret = GS_UNSUPPORTED_VERSION;
|
||||||
@ -646,7 +646,7 @@ int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, b
|
|||||||
mode = mode->next;
|
mode = mode->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!correct_mode)
|
if (!correct_mode && !server->unsupported)
|
||||||
return GS_NOT_SUPPORTED_MODE;
|
return GS_NOT_SUPPORTED_MODE;
|
||||||
|
|
||||||
if (config->height >= 2160 && !server->supports4K)
|
if (config->height >= 2160 && !server->supports4K)
|
||||||
@ -727,7 +727,7 @@ int gs_quit_app(PSERVER_DATA server) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gs_init(PSERVER_DATA server, char *address, const char *keyDirectory, int log_level) {
|
int gs_init(PSERVER_DATA server, char *address, const char *keyDirectory, int log_level, bool unsupported) {
|
||||||
mkdirtree(keyDirectory);
|
mkdirtree(keyDirectory);
|
||||||
if (load_unique_id(keyDirectory) != GS_OK)
|
if (load_unique_id(keyDirectory) != GS_OK)
|
||||||
return GS_FAILED;
|
return GS_FAILED;
|
||||||
@ -739,5 +739,6 @@ int gs_init(PSERVER_DATA server, char *address, const char *keyDirectory, int lo
|
|||||||
|
|
||||||
LiInitializeServerInformation(&server->serverInfo);
|
LiInitializeServerInformation(&server->serverInfo);
|
||||||
server->serverInfo.address = address;
|
server->serverInfo.address = address;
|
||||||
|
server->unsupported = unsupported;
|
||||||
return load_server_status(server);
|
return load_server_status(server);
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ typedef struct _SERVER_DATA {
|
|||||||
char* gpuType;
|
char* gpuType;
|
||||||
bool paired;
|
bool paired;
|
||||||
bool supports4K;
|
bool supports4K;
|
||||||
|
bool unsupported;
|
||||||
int currentGame;
|
int currentGame;
|
||||||
int serverMajorVersion;
|
int serverMajorVersion;
|
||||||
char* gsVersion;
|
char* gsVersion;
|
||||||
@ -40,7 +41,7 @@ typedef struct _SERVER_DATA {
|
|||||||
SERVER_INFORMATION serverInfo;
|
SERVER_INFORMATION serverInfo;
|
||||||
} SERVER_DATA, *PSERVER_DATA;
|
} SERVER_DATA, *PSERVER_DATA;
|
||||||
|
|
||||||
int gs_init(PSERVER_DATA server, char* address, const char *keyDirectory, int logLevel);
|
int gs_init(PSERVER_DATA server, char* address, const char *keyDirectory, int logLevel, bool unsupported);
|
||||||
int gs_start_app(PSERVER_DATA server, PSTREAM_CONFIGURATION config, int appId, bool sops, bool localaudio);
|
int gs_start_app(PSERVER_DATA server, PSTREAM_CONFIGURATION config, int appId, bool sops, bool localaudio);
|
||||||
int gs_applist(PSERVER_DATA server, PAPP_LIST *app_list);
|
int gs_applist(PSERVER_DATA server, PAPP_LIST *app_list);
|
||||||
int gs_unpair(PSERVER_DATA server);
|
int gs_unpair(PSERVER_DATA server);
|
||||||
|
@ -203,7 +203,7 @@ static void parse_argument(int c, char* value, PCONFIGURATION config) {
|
|||||||
config->codec = CODEC_HEVC;
|
config->codec = CODEC_HEVC;
|
||||||
break;
|
break;
|
||||||
case 'y':
|
case 'y':
|
||||||
config->unsupported_version = true;
|
config->unsupported = true;
|
||||||
break;
|
break;
|
||||||
case 'z':
|
case 'z':
|
||||||
config->debug_level = 1;
|
config->debug_level = 1;
|
||||||
@ -307,7 +307,7 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) {
|
|||||||
config->sops = true;
|
config->sops = true;
|
||||||
config->localaudio = false;
|
config->localaudio = false;
|
||||||
config->fullscreen = true;
|
config->fullscreen = true;
|
||||||
config->unsupported_version = false;
|
config->unsupported = false;
|
||||||
config->codec = CODEC_UNSPECIFIED;
|
config->codec = CODEC_UNSPECIFIED;
|
||||||
|
|
||||||
config->inputsCount = 0;
|
config->inputsCount = 0;
|
||||||
|
@ -39,7 +39,7 @@ typedef struct _CONFIGURATION {
|
|||||||
bool sops;
|
bool sops;
|
||||||
bool localaudio;
|
bool localaudio;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
bool unsupported_version;
|
bool unsupported;
|
||||||
char* inputs[MAX_INPUTS];
|
char* inputs[MAX_INPUTS];
|
||||||
int inputsCount;
|
int inputsCount;
|
||||||
enum codecs codec;
|
enum codecs codec;
|
||||||
|
12
src/main.c
12
src/main.c
@ -95,7 +95,7 @@ static void stream(PSERVER_DATA server, PCONFIGURATION config, enum platform sys
|
|||||||
if (ret == GS_NOT_SUPPORTED_4K)
|
if (ret == GS_NOT_SUPPORTED_4K)
|
||||||
fprintf(stderr, "Server doesn't support 4K\n");
|
fprintf(stderr, "Server doesn't support 4K\n");
|
||||||
else if (ret == GS_NOT_SUPPORTED_MODE)
|
else if (ret == GS_NOT_SUPPORTED_MODE)
|
||||||
fprintf(stderr, "Server doesn't support %dx%d (%d fps)\n", config->stream.width, config->stream.height, config->stream.fps);
|
fprintf(stderr, "Server doesn't support %dx%d (%d fps) or try --unsupported option\n", config->stream.width, config->stream.height, config->stream.fps);
|
||||||
else
|
else
|
||||||
fprintf(stderr, "Errorcode starting app: %d\n", ret);
|
fprintf(stderr, "Errorcode starting app: %d\n", ret);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@ -161,7 +161,7 @@ static void help() {
|
|||||||
printf("\t-keydir <directory>\tLoad encryption keys from directory\n");
|
printf("\t-keydir <directory>\tLoad encryption keys from directory\n");
|
||||||
printf("\t-mapping <file>\t\tUse <file> as gamepad mappings configuration file\n");
|
printf("\t-mapping <file>\t\tUse <file> as gamepad mappings configuration file\n");
|
||||||
printf("\t-platform <system>\tSpecify system used for audio, video and input: pi/imx/aml/x11/x11_vdpau/sdl/fake (default auto)\n");
|
printf("\t-platform <system>\tSpecify system used for audio, video and input: pi/imx/aml/x11/x11_vdpau/sdl/fake (default auto)\n");
|
||||||
printf("\t-unsupported\t\tTry streaming if GFE version is unsupported\n");
|
printf("\t-unsupported\t\tTry streaming if GFE version or options are unsupported\n");
|
||||||
#if defined(HAVE_SDL) || defined(HAVE_X11)
|
#if defined(HAVE_SDL) || defined(HAVE_X11)
|
||||||
printf("\n WM options (SDL and X11 only)\n\n");
|
printf("\n WM options (SDL and X11 only)\n\n");
|
||||||
printf("\t-windowed\t\tDisplay screen in a window\n");
|
printf("\t-windowed\t\tDisplay screen in a window\n");
|
||||||
@ -216,17 +216,15 @@ int main(int argc, char* argv[]) {
|
|||||||
printf("Connect to %s...\n", config.address);
|
printf("Connect to %s...\n", config.address);
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
if ((ret = gs_init(&server, config.address, config.key_dir, config.debug_level)) == GS_OUT_OF_MEMORY) {
|
if ((ret = gs_init(&server, config.address, config.key_dir, config.debug_level, config.unsupported)) == GS_OUT_OF_MEMORY) {
|
||||||
fprintf(stderr, "Not enough memory\n");
|
fprintf(stderr, "Not enough memory\n");
|
||||||
exit(-1);
|
exit(-1);
|
||||||
} else if (ret == GS_INVALID) {
|
} else if (ret == GS_INVALID) {
|
||||||
fprintf(stderr, "Invalid data received from server: %s\n", config.address, gs_error);
|
fprintf(stderr, "Invalid data received from server: %s\n", config.address, gs_error);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
} else if (ret == GS_UNSUPPORTED_VERSION) {
|
} else if (ret == GS_UNSUPPORTED_VERSION) {
|
||||||
if (!config.unsupported_version) {
|
fprintf(stderr, "Unsupported version: %s\n", gs_error);
|
||||||
fprintf(stderr, "Unsupported version: %s\n", gs_error);
|
exit(-1);
|
||||||
exit(-1);
|
|
||||||
}
|
|
||||||
} else if (ret != GS_OK) {
|
} else if (ret != GS_OK) {
|
||||||
fprintf(stderr, "Can't connect to server %s\n", config.address);
|
fprintf(stderr, "Can't connect to server %s\n", config.address);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user