mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-07-03 16:25:31 +00:00
Update libgamestream for h265
This commit is contained in:
parent
e53be38bdb
commit
48bbcbf954
@ -95,6 +95,11 @@ Change the network packetsize to I<PACKETSIZE>.
|
|||||||
The packetsize should the smaller than the MTU of the network.
|
The packetsize should the smaller than the MTU of the network.
|
||||||
By default a safe value of 1024 is used.
|
By default a safe value of 1024 is used.
|
||||||
|
|
||||||
|
=item B<-forcehevc>
|
||||||
|
|
||||||
|
Request a h265/HEVC from the server.
|
||||||
|
Will still use h264 if server doesn't support HEVC.
|
||||||
|
|
||||||
=item B<-remote>
|
=item B<-remote>
|
||||||
|
|
||||||
Enable the optimizations for remote connections in GFE.
|
Enable the optimizations for remote connections in GFE.
|
||||||
|
@ -172,6 +172,7 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
char *stateText = NULL;
|
char *stateText = NULL;
|
||||||
char *heightText = NULL;
|
char *heightText = NULL;
|
||||||
char *serverCodecModeSupportText = NULL;
|
char *serverCodecModeSupportText = NULL;
|
||||||
|
char *maxLumaPixelsHEVC = NULL;
|
||||||
|
|
||||||
uuid_t uuid;
|
uuid_t uuid;
|
||||||
char uuid_str[37];
|
char uuid_str[37];
|
||||||
@ -211,9 +212,13 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
if (xml_search(data->memory, data->size, "ServerCodecModeSupport", &serverCodecModeSupportText) != GS_OK)
|
if (xml_search(data->memory, data->size, "ServerCodecModeSupport", &serverCodecModeSupportText) != GS_OK)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (xml_search(data->memory, data->size, "gputype", &server->gpuType) != GS_OK)
|
||||||
|
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;
|
||||||
|
server->maxLumaPixelsHEVC = maxLumaPixelsHEVC == NULL ? 0 : atol(maxLumaPixelsHEVC);
|
||||||
char *versionSep = strstr(versionText, ".");
|
char *versionSep = strstr(versionText, ".");
|
||||||
if (versionSep != NULL) {
|
if (versionSep != NULL) {
|
||||||
*versionSep = 0;
|
*versionSep = 0;
|
||||||
@ -246,6 +251,9 @@ static int load_server_status(PSERVER_DATA server) {
|
|||||||
if (serverCodecModeSupportText != NULL)
|
if (serverCodecModeSupportText != NULL)
|
||||||
free(serverCodecModeSupportText);
|
free(serverCodecModeSupportText);
|
||||||
|
|
||||||
|
if (maxLumaPixelsHEVC != NULL)
|
||||||
|
free(maxLumaPixelsHEVC);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,6 +485,11 @@ int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, b
|
|||||||
if (data == NULL)
|
if (data == NULL)
|
||||||
return GS_OUT_OF_MEMORY;
|
return GS_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
//Check support for H.265 video
|
||||||
|
//TODO: Find a better way to detect this
|
||||||
|
if (!(config->supportsHevc && server->maxLumaPixelsHEVC > 0 && server->gpuType != NULL && strstr(server->gpuType, "GTX 9")))
|
||||||
|
config->supportsHevc = VIDEO_FORMAT_H264;
|
||||||
|
|
||||||
uuid_generate_random(uuid);
|
uuid_generate_random(uuid);
|
||||||
uuid_unparse(uuid, uuid_str);
|
uuid_unparse(uuid, uuid_str);
|
||||||
if (server->currentGame == 0) {
|
if (server->currentGame == 0) {
|
||||||
|
@ -27,10 +27,12 @@
|
|||||||
|
|
||||||
typedef struct _SERVER_DATA {
|
typedef struct _SERVER_DATA {
|
||||||
const char* address;
|
const char* address;
|
||||||
|
char* gpuType;
|
||||||
bool paired;
|
bool paired;
|
||||||
bool supports4K;
|
bool supports4K;
|
||||||
int currentGame;
|
int currentGame;
|
||||||
int serverMajorVersion;
|
int serverMajorVersion;
|
||||||
|
long maxLumaPixelsHEVC;
|
||||||
} SERVER_DATA, *PSERVER_DATA;
|
} SERVER_DATA, *PSERVER_DATA;
|
||||||
|
|
||||||
int gs_init(PSERVER_DATA server, const char *keyDirectory);
|
int gs_init(PSERVER_DATA server, const char *keyDirectory);
|
||||||
|
@ -17,6 +17,9 @@
|
|||||||
## Size of network packets should be lower than MTU
|
## Size of network packets should be lower than MTU
|
||||||
#packetsize = 1024
|
#packetsize = 1024
|
||||||
|
|
||||||
|
## Use of h265/HEVC video codec
|
||||||
|
#h265 = false
|
||||||
|
|
||||||
## Default started application on host
|
## Default started application on host
|
||||||
#app = Steam
|
#app = Steam
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ static void parse_argument(int c, char* value, PCONFIGURATION config) {
|
|||||||
config->forcehw = true;
|
config->forcehw = true;
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
config->hevc = true;
|
config->stream.supportsHevc = true;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (config->action == NULL)
|
if (config->action == NULL)
|
||||||
@ -285,6 +285,7 @@ void config_parse(int argc, char* argv[], PCONFIGURATION config) {
|
|||||||
config->stream.packetSize = 1024;
|
config->stream.packetSize = 1024;
|
||||||
config->stream.streamingRemotely = 0;
|
config->stream.streamingRemotely = 0;
|
||||||
config->stream.audioConfiguration = AUDIO_CONFIGURATION_STEREO;
|
config->stream.audioConfiguration = AUDIO_CONFIGURATION_STEREO;
|
||||||
|
config->stream.supportsHevc = false;
|
||||||
|
|
||||||
config->platform = "default";
|
config->platform = "default";
|
||||||
config->app = "Steam";
|
config->app = "Steam";
|
||||||
@ -294,7 +295,6 @@ 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->hevc = false;
|
|
||||||
|
|
||||||
config->inputsCount = 0;
|
config->inputsCount = 0;
|
||||||
config->mapping = get_path("mappings/default.conf", getenv("XDG_DATA_DIRS"));
|
config->mapping = get_path("mappings/default.conf", getenv("XDG_DATA_DIRS"));
|
||||||
|
@ -43,7 +43,6 @@ typedef struct _CONFIGURATION {
|
|||||||
bool forcehw;
|
bool forcehw;
|
||||||
struct input_config inputs[MAX_INPUTS];
|
struct input_config inputs[MAX_INPUTS];
|
||||||
int inputsCount;
|
int inputsCount;
|
||||||
bool hevc;
|
|
||||||
} CONFIGURATION, *PCONFIGURATION;
|
} CONFIGURATION, *PCONFIGURATION;
|
||||||
|
|
||||||
bool inputAdded;
|
bool inputAdded;
|
||||||
|
@ -83,11 +83,6 @@ static void stream(PSERVER_DATA server, PCONFIGURATION config, enum platform sys
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// h265
|
|
||||||
if (config->hevc) {
|
|
||||||
config->stream.supportsHevc = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ret = gs_start_app(server, &config->stream, appId, config->sops, config->localaudio);
|
int ret = gs_start_app(server, &config->stream, appId, config->sops, config->localaudio);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ret == GS_NOT_SUPPORTED_4K)
|
if (ret == GS_NOT_SUPPORTED_4K)
|
||||||
@ -142,7 +137,7 @@ static void help() {
|
|||||||
printf("\t-60fps\t\t\tUse 60fps [default]\n");
|
printf("\t-60fps\t\t\tUse 60fps [default]\n");
|
||||||
printf("\t-bitrate <bitrate>\tSpecify the bitrate in Kbps\n");
|
printf("\t-bitrate <bitrate>\tSpecify the bitrate in Kbps\n");
|
||||||
printf("\t-packetsize <size>\tSpecify the maximum packetsize in bytes\n");
|
printf("\t-packetsize <size>\tSpecify the maximum packetsize in bytes\n");
|
||||||
printf("\t-hevc \t\tUse high efficiency video decoding (HEVC)\n");
|
printf("\t-forcehevc\t\tUse high efficiency video decoding (HEVC)\n");
|
||||||
printf("\t-remote\t\t\tEnable remote optimizations\n");
|
printf("\t-remote\t\t\tEnable remote optimizations\n");
|
||||||
printf("\t-app <app>\t\tName of app to stream\n");
|
printf("\t-app <app>\t\tName of app to stream\n");
|
||||||
printf("\t-nosops\t\t\tDon't allow GFE to modify game settings\n");
|
printf("\t-nosops\t\t\tDon't allow GFE to modify game settings\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user