Use the same remote streaming and packet size defaults as other clients

This commit is contained in:
Cameron Gutman 2021-07-24 15:57:55 -05:00
parent 56d1fee17b
commit b907c4b608
3 changed files with 23 additions and 13 deletions

View File

@ -93,8 +93,8 @@ For other configurations, 5 Mbps is used by default.
Change the network packetsize to I<PACKETSIZE> bytes.
The packetsize should the smaller than the MTU of the network.
This value must be a multiply of 16.
By default a safe value of 1024 is used.
This value must be a multiple of 16.
By default, 1392 is used on LAN and 1024 on WAN.
=item B<-codec> [I<CODEC>]
@ -103,9 +103,9 @@ Can be 'auto', 'h264', 'h265' or 'hevc'.
Not all video decoders do support H.265/HEVC.
Will still use H.264 if server doesn't support HEVC.
=item B<-remote>
=item B<-remote> [I<yes/no/auto>]
Enable the optimizations for remote connections in GFE.
Enable optimizations for LAN or WAN streaming.
=item B<-app> [I<APP>]

View File

@ -15,7 +15,8 @@
#bitrate = -1
## Size of network packets should be lower than MTU
#packetsize = 1024
## If streaming with WAN optimizations, this will be capped at 1024.
#packetsize = 1392
## Select video codec (auto/h264/h265)
#codec = auto
@ -64,8 +65,11 @@
## By default keys are stored in $XDG_CACHE_DIR/moonlight or ~/.cache/moonlight
#keydir = /dir/to/keys
## Enable QOS settings to optimize for internet instead of local network
#remote = false
## Enable QOS settings to optimize for internet or local network
## yes - optimize for WAN streaming
## no - optimize for LAN streaming
## auto (default) - decide automatically based on target IP address
#remote = auto
## Enable 5.1/7.1 surround sound
#surround = 5.1

View File

@ -59,7 +59,7 @@ static struct option long_options[] = {
{"platform", required_argument, NULL, 'p'},
{"save", required_argument, NULL, 'q'},
{"keydir", required_argument, NULL, 'r'},
{"remote", no_argument, NULL, 's'},
{"remote", required_argument, NULL, 's'},
{"windowed", no_argument, NULL, 't'},
{"surround", required_argument, NULL, 'u'},
{"fps", required_argument, NULL, 'v'},
@ -193,8 +193,14 @@ static void parse_argument(int c, char* value, PCONFIGURATION config) {
strcpy(config->key_dir, value);
break;
case 's':
config->stream.streamingRemotely = 1;
if (strcasecmp(value, "auto") == 0)
config->stream.streamingRemotely = STREAM_CFG_AUTO;
else if (strcasecmp(value, "true") == 0 || strcasecmp(value, "yes") == 0)
config->stream.streamingRemotely = STREAM_CFG_REMOTE;
else if (strcasecmp(value, "false") == 0 || strcasecmp(value, "no") == 0)
config->stream.streamingRemotely = STREAM_CFG_LOCAL;
break;
case 't':
config->fullscreen = false;
break;
@ -212,7 +218,7 @@ static void parse_argument(int c, char* value, PCONFIGURATION config) {
config->codec = CODEC_UNSPECIFIED;
else if (strcasecmp(value, "h264") == 0)
config->codec = CODEC_H264;
if (strcasecmp(value, "h265") == 0 || strcasecmp(value, "hevc") == 0)
else if (strcasecmp(value, "h265") == 0 || strcasecmp(value, "hevc") == 0)
config->codec = CODEC_HEVC;
break;
case 'y':
@ -318,8 +324,8 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) {
config->stream.height = 720;
config->stream.fps = 60;
config->stream.bitrate = -1;
config->stream.packetSize = 1024;
config->stream.streamingRemotely = 0;
config->stream.packetSize = 1392;
config->stream.streamingRemotely = STREAM_CFG_AUTO;
config->stream.audioConfiguration = AUDIO_CONFIGURATION_STEREO;
config->stream.supportsHevc = false;
@ -355,7 +361,7 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) {
} else {
int option_index = 0;
int c;
while ((c = getopt_long_only(argc, argv, "-abc:d:efg:h:i:j:k:lm:no:p:q:r:stu:v:w:xy", long_options, &option_index)) != -1) {
while ((c = getopt_long_only(argc, argv, "-abc:d:efg:h:i:j:k:lm:no:p:q:r:s:tu:v:w:xy", long_options, &option_index)) != -1) {
parse_argument(c, optarg, config);
}
}