Skip to content
Permalink
Browse files

gui: Add new setting option `Enable stream optimization`

this feature will on/off streamingRemotely option.
might be help to connection over the internet.
(but not tested)

ref: https://github.com/moonlight-stream/moonlight-common-c/blob/26fe1cb/src/Limelight.h#L28-L30
  • Loading branch information...
d3m3vilurr committed Jan 16, 2018
1 parent 098ac3c commit d2c974a412911c499832bace5f16fcc2276d9a28
Showing with 16 additions and 0 deletions.
  1. +3 −0 src/config.c
  2. +13 −0 src/gui/ui_settings.c
@@ -227,6 +227,8 @@ static int ini_handle(void *out, const char *section, const char *name,
config->mouse_acceleration = INT(value);
} else if (strcmp(name, "enable_ref_frame_invalidation") == 0) {
config->enable_ref_frame_invalidation = BOOL(value);
} else if (strcmp(name, "enable_remote_stream_optimization") == 0) {
config->stream.streamingRemotely = INT(value);
}
}
}
@@ -271,6 +273,7 @@ void config_save(const char* filename, PCONFIGURATION config) {

write_config_int(fd, "mouse_acceleration", config->mouse_acceleration);
write_config_bool(fd, "enable_ref_frame_invalidation", config->enable_ref_frame_invalidation);
write_config_int(fd, "enable_remote_stream_optimization", config->stream.streamingRemotely);

write_config_section(fd, "backtouchscreen_deadzone");
write_config_int(fd, "top", config->back_deadzone.top);
@@ -340,6 +340,7 @@ enum {
SETTINGS_BITRATE,
SETTINGS_SOPS,
SETTINGS_ENABLE_FRAME_INVAL,
SETTINGS_ENABLE_STREAM_OPTIMIZE,
SETTINGS_SAVE_DEBUG_LOG,
SETTINGS_DISABLE_POWERSAVE,
SETTINGS_ENABLE_MAPPING,
@@ -355,6 +356,7 @@ enum {
SETTINGS_VIEW_BITRATE,
SETTINGS_VIEW_SOPS,
SETTINGS_VIEW_ENABLE_FRAME_INVAL,
SETTINGS_VIEW_ENABLE_STREAM_OPTIMIZE,
SETTINGS_VIEW_SAVE_DEBUG_LOG,
SETTINGS_VIEW_DISABLE_POWERSAVE,
SETTINGS_VIEW_ENABLE_MAPPING,
@@ -455,6 +457,13 @@ static int settings_loop(int id, void *context, const input_data *input) {
did_change = 1;
config.enable_ref_frame_invalidation = !config.enable_ref_frame_invalidation;
break;
case SETTINGS_ENABLE_STREAM_OPTIMIZE:
if ((input->buttons & SCE_CTRL_CROSS) == 0 || input->buttons & SCE_CTRL_HOLD) {
break;
}
did_change = 1;
config.stream.streamingRemotely = config.stream.streamingRemotely ? 0 : 1;
break;
case SETTINGS_SAVE_DEBUG_LOG:
if ((input->buttons & SCE_CTRL_CROSS) == 0 || input->buttons & SCE_CTRL_HOLD) {
break;
@@ -540,6 +549,9 @@ static int settings_loop(int id, void *context, const input_data *input) {
sprintf(current, "%s", config.enable_ref_frame_invalidation ? "yes" : "no");
MENU_REPLACE(SETTINGS_VIEW_ENABLE_FRAME_INVAL, current);

sprintf(current, "%s", config.stream.streamingRemotely ? "yes" : "no");
MENU_REPLACE(SETTINGS_VIEW_ENABLE_STREAM_OPTIMIZE, current);

sprintf(current, "%s", config.disable_powersave ? "yes" : "no");
MENU_REPLACE(SETTINGS_VIEW_DISABLE_POWERSAVE, current);

@@ -594,6 +606,7 @@ int ui_settings_menu() {
MENU_ENTRY(SETTINGS_BITRATE, SETTINGS_VIEW_BITRATE, "Bitrate", "");
MENU_ENTRY(SETTINGS_SOPS, SETTINGS_VIEW_SOPS, "Change graphical game settings for performance", "");
MENU_ENTRY(SETTINGS_ENABLE_FRAME_INVAL, SETTINGS_VIEW_ENABLE_FRAME_INVAL, "Enable reference frame invalidation", "");
MENU_ENTRY(SETTINGS_ENABLE_STREAM_OPTIMIZE, SETTINGS_VIEW_ENABLE_STREAM_OPTIMIZE, "Enable stream optimization", "");

MENU_CATEGORY("System");
MENU_ENTRY(SETTINGS_SAVE_DEBUG_LOG, SETTINGS_VIEW_SAVE_DEBUG_LOG, "Enable debug log", "");

0 comments on commit d2c974a

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