Skip to content
Permalink
Browse files

Provide gamepad mask at startup

  • Loading branch information...
irtimmer authored and d3m3vilurr committed Apr 8, 2018
1 parent 8e77710 commit 933d700ea12133db7c5599baa7ec9fdca9dacae7
Showing with 6 additions and 5 deletions.
  1. +2 −2 libgamestream/client.c
  2. +2 −2 libgamestream/client.h
  3. +2 −1 src/gui/ui_connect.c
@@ -658,7 +658,7 @@ int gs_applist(PSERVER_DATA server, PAPP_LIST *list) {
return ret;
}

int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, bool sops, bool localaudio, bool custom_res) {
int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, bool sops, bool localaudio, int gamepad_mask, bool custom_res) {
int ret = GS_OK;
uuid_t uuid;
char* result = NULL;
@@ -699,7 +699,7 @@ int gs_start_app(PSERVER_DATA server, STREAM_CONFIGURATION *config, int appId, b
if (server->currentGame == 0) {
int channelCounnt = config->audioConfiguration == AUDIO_CONFIGURATION_STEREO ? CHANNEL_COUNT_STEREO : CHANNEL_COUNT_51_SURROUND;
int mask = config->audioConfiguration == AUDIO_CONFIGURATION_STEREO ? CHANNEL_MASK_STEREO : CHANNEL_MASK_51_SURROUND;
sprintf(url, "https://%s:47984/launch?uniqueid=%s&uuid=%s&appid=%d&mode=%dx%dx%d&additionalStates=1&sops=%d&rikey=%s&rikeyid=%d&localAudioPlayMode=%d&surroundAudioInfo=%d", server->serverInfo.address, unique_id, uuid_str, appId, config->width, config->height, config->fps, sops, rikey_hex, rikeyid, localaudio, (mask << 16) + channelCounnt);
snprintf(url, sizeof(url), "https://%s:47984/launch?uniqueid=%s&uuid=%s&appid=%d&mode=%dx%dx%d&additionalStates=1&sops=%d&rikey=%s&rikeyid=%d&localAudioPlayMode=%d&surroundAudioInfo=%d&remoteControllersBitmap=%d&gcmap=%d", server->serverInfo.address, unique_id, uuid_str, appId, config->width, config->height, config->fps, sops, rikey_hex, rikeyid, localaudio, (mask << 16) + channelCounnt, gamepad_mask, gamepad_mask);
} else
sprintf(url, "https://%s:47984/resume?uniqueid=%s&uuid=%s&rikey=%s&rikeyid=%d", server->serverInfo.address, unique_id, uuid_str, rikey_hex, rikeyid);

@@ -40,8 +40,8 @@ typedef struct _SERVER_DATA {
SERVER_INFORMATION serverInfo;
} SERVER_DATA, *PSERVER_DATA;

int gs_init(PSERVER_DATA server, char* address, const char *keyDirectory);
int gs_start_app(PSERVER_DATA server, PSTREAM_CONFIGURATION config, int appId, bool sops, bool localaudio, bool custom_res);
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 gamepad_mask, bool custom_res);
int gs_applist(PSERVER_DATA server, PAPP_LIST *app_list);
int gs_unpair(PSERVER_DATA server);
int gs_pair(PSERVER_DATA server, char* pin);
@@ -54,7 +54,8 @@ int get_app_name(PAPP_LIST list, int id, char *name) {
}

void ui_connect_stream(PSERVER_DATA server, int appId) {
int ret = gs_start_app(server, &config.stream, appId, config.sops, config.localaudio, true);
// TODO support force controller id
int ret = gs_start_app(server, &config.stream, appId, config.sops, config.localaudio, 1, true);
if (ret < 0) {
if (ret == GS_NOT_SUPPORTED_4K)
display_error("Server doesn't support 4K\n");

0 comments on commit 933d700

Please sign in to comment.
You can’t perform that action at this time.