Update libgamestream for h265

This commit is contained in:
Iwan Timmer
2016-02-01 13:53:48 +01:00
parent e53be38bdb
commit 48bbcbf954
7 changed files with 26 additions and 9 deletions

View File

@@ -172,6 +172,7 @@ static int load_server_status(PSERVER_DATA server) {
char *stateText = NULL;
char *heightText = NULL;
char *serverCodecModeSupportText = NULL;
char *maxLumaPixelsHEVC = NULL;
uuid_t uuid;
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)
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->currentGame = currentGameText == NULL ? 0 : atoi(currentGameText);
server->supports4K = heightText != NULL && serverCodecModeSupportText != NULL && atoi(heightText) >= 2160;
server->maxLumaPixelsHEVC = maxLumaPixelsHEVC == NULL ? 0 : atol(maxLumaPixelsHEVC);
char *versionSep = strstr(versionText, ".");
if (versionSep != NULL) {
*versionSep = 0;
@@ -246,6 +251,9 @@ static int load_server_status(PSERVER_DATA server) {
if (serverCodecModeSupportText != NULL)
free(serverCodecModeSupportText);
if (maxLumaPixelsHEVC != NULL)
free(maxLumaPixelsHEVC);
return ret;
}
@@ -477,6 +485,11 @@ int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, b
if (data == NULL)
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_unparse(uuid, uuid_str);
if (server->currentGame == 0) {

View File

@@ -27,10 +27,12 @@
typedef struct _SERVER_DATA {
const char* address;
char* gpuType;
bool paired;
bool supports4K;
int currentGame;
int serverMajorVersion;
long maxLumaPixelsHEVC;
} SERVER_DATA, *PSERVER_DATA;
int gs_init(PSERVER_DATA server, const char *keyDirectory);