mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-01 23:35:47 +00:00
Add option for sending quit app request after quitting streaming session
* By default this option is set to `false` and can be enabled using the new `-quitappafter`/`quitappafter` command-line/config options.
This commit is contained in:
parent
7a32234c0b
commit
d0f5f90dea
@ -145,6 +145,10 @@ Select platform for audio and video output and input.
|
|||||||
|
|
||||||
Try streaming if GFE version or options are unsupported
|
Try streaming if GFE version or options are unsupported
|
||||||
|
|
||||||
|
=item B<-quitappafter>
|
||||||
|
|
||||||
|
Send quit app request to remote after quitting session
|
||||||
|
|
||||||
=item B<-verbose>
|
=item B<-verbose>
|
||||||
|
|
||||||
Enable verbose output
|
Enable verbose output
|
||||||
|
@ -40,6 +40,9 @@
|
|||||||
## Play audio on host instead of streaming to client
|
## Play audio on host instead of streaming to client
|
||||||
#localaudio = false
|
#localaudio = false
|
||||||
|
|
||||||
|
## Send quit app request to remote after quitting session
|
||||||
|
#quitappafter = false
|
||||||
|
|
||||||
## Select audio device to play sound on
|
## Select audio device to play sound on
|
||||||
#audio = sysdefault
|
#audio = sysdefault
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ static struct option long_options[] = {
|
|||||||
{"fps", required_argument, NULL, 'v'},
|
{"fps", required_argument, NULL, 'v'},
|
||||||
{"codec", required_argument, NULL, 'x'},
|
{"codec", required_argument, NULL, 'x'},
|
||||||
{"unsupported", no_argument, NULL, 'y'},
|
{"unsupported", no_argument, NULL, 'y'},
|
||||||
|
{"quitappafter", no_argument, NULL, '1'},
|
||||||
{"verbose", no_argument, NULL, 'z'},
|
{"verbose", no_argument, NULL, 'z'},
|
||||||
{"debug", no_argument, NULL, 'Z'},
|
{"debug", no_argument, NULL, 'Z'},
|
||||||
{0, 0, 0, 0},
|
{0, 0, 0, 0},
|
||||||
@ -212,6 +213,9 @@ static void parse_argument(int c, char* value, PCONFIGURATION config) {
|
|||||||
case 'y':
|
case 'y':
|
||||||
config->unsupported = true;
|
config->unsupported = true;
|
||||||
break;
|
break;
|
||||||
|
case '1':
|
||||||
|
config->quitappafter = true;
|
||||||
|
break;
|
||||||
case 'z':
|
case 'z':
|
||||||
config->debug_level = 1;
|
config->debug_level = 1;
|
||||||
break;
|
break;
|
||||||
@ -249,6 +253,8 @@ bool config_file_parse(char* filename, PCONFIGURATION config) {
|
|||||||
config->sops = strcmp("true", value) == 0;
|
config->sops = strcmp("true", value) == 0;
|
||||||
} else if (strcmp(key, "localaudio") == 0) {
|
} else if (strcmp(key, "localaudio") == 0) {
|
||||||
config->localaudio = strcmp("true", value) == 0;
|
config->localaudio = strcmp("true", value) == 0;
|
||||||
|
} else if (strcmp(key, "quitappafter") == 0) {
|
||||||
|
config->quitappafter = strcmp("true", value) == 0;
|
||||||
} else {
|
} else {
|
||||||
for (int i=0;long_options[i].name != NULL;i++) {
|
for (int i=0;long_options[i].name != NULL;i++) {
|
||||||
if (strcmp(long_options[i].name, key) == 0) {
|
if (strcmp(long_options[i].name, key) == 0) {
|
||||||
@ -285,6 +291,8 @@ void config_save(char* filename, PCONFIGURATION config) {
|
|||||||
write_config_bool(fd, "sops", config->sops);
|
write_config_bool(fd, "sops", config->sops);
|
||||||
if (config->localaudio)
|
if (config->localaudio)
|
||||||
write_config_bool(fd, "localaudio", config->localaudio);
|
write_config_bool(fd, "localaudio", config->localaudio);
|
||||||
|
if (config->quitappafter)
|
||||||
|
write_config_bool(fd, "quitappafter", config->quitappafter);
|
||||||
|
|
||||||
if (strcmp(config->app, "Steam") != 0)
|
if (strcmp(config->app, "Steam") != 0)
|
||||||
write_config_string(fd, "app", config->app);
|
write_config_string(fd, "app", config->app);
|
||||||
@ -315,6 +323,7 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) {
|
|||||||
config->localaudio = false;
|
config->localaudio = false;
|
||||||
config->fullscreen = true;
|
config->fullscreen = true;
|
||||||
config->unsupported = false;
|
config->unsupported = false;
|
||||||
|
config->quitappafter = false;
|
||||||
config->codec = CODEC_UNSPECIFIED;
|
config->codec = CODEC_UNSPECIFIED;
|
||||||
|
|
||||||
config->inputsCount = 0;
|
config->inputsCount = 0;
|
||||||
|
@ -40,6 +40,7 @@ typedef struct _CONFIGURATION {
|
|||||||
bool localaudio;
|
bool localaudio;
|
||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
bool unsupported;
|
bool unsupported;
|
||||||
|
bool quitappafter;
|
||||||
char* inputs[MAX_INPUTS];
|
char* inputs[MAX_INPUTS];
|
||||||
int inputsCount;
|
int inputsCount;
|
||||||
enum codecs codec;
|
enum codecs codec;
|
||||||
|
@ -135,6 +135,13 @@ static void stream(PSERVER_DATA server, PCONFIGURATION config, enum platform sys
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
LiStopConnection();
|
LiStopConnection();
|
||||||
|
|
||||||
|
if (config->quitappafter) {
|
||||||
|
if (config->debug_level > 0)
|
||||||
|
printf("Sending app quit request ...\n");
|
||||||
|
gs_quit_app(server);
|
||||||
|
}
|
||||||
|
|
||||||
platform_stop(system);
|
platform_stop(system);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,6 +181,7 @@ static void help() {
|
|||||||
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/rk/x11/x11_vdpau/sdl/fake (default auto)\n");
|
printf("\t-platform <system>\tSpecify system used for audio, video and input: pi/imx/aml/rk/x11/x11_vdpau/sdl/fake (default auto)\n");
|
||||||
printf("\t-unsupported\t\tTry streaming if GFE version or options are unsupported\n");
|
printf("\t-unsupported\t\tTry streaming if GFE version or options are unsupported\n");
|
||||||
|
printf("\t-quitappafter\t\tSend quit app request to remote after quitting session\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");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user