Add option for change video windows offsets, from video output

This commit is contained in:
Francisco Javier Trujillo Mata 2021-08-11 19:13:40 +02:00
parent 2c355419bd
commit c8a46e6e69
9 changed files with 99 additions and 0 deletions

View File

@ -280,6 +280,12 @@
#define DEFAULT_FULLSCREEN_Y 0
#endif
#if defined(HAVE_WINDOW_OFFSET)
/* Screen offsets to center content in CTRs */
#define DEFAULT_WINDOW_OFFSET_X 0
#define DEFAULT_WINDOW_OFFSET_Y 0
#endif
/* Number of threads to use for video recording */
#define DEFAULT_VIDEO_RECORD_THREADS 2

View File

@ -2327,6 +2327,10 @@ static struct config_int_setting *populate_settings_int(
#endif
#ifdef HAVE_D3D12
SETTING_INT("d3d12_gpu_index", &settings->ints.d3d12_gpu_index, true, DEFAULT_D3D12_GPU_INDEX, false);
#endif
#ifdef HAVE_WINDOW_OFFSET
SETTING_INT("video_window_offset_x", &settings->ints.video_window_offset_x, true, DEFAULT_WINDOW_OFFSET_X, false);
SETTING_INT("video_window_offset_y", &settings->ints.video_window_offset_y, true, DEFAULT_WINDOW_OFFSET_Y, false);
#endif
SETTING_INT("content_favorites_size", &settings->ints.content_favorites_size, true, default_content_favorites_size, false);

View File

@ -140,6 +140,10 @@ typedef struct settings
#endif
#ifdef HAVE_D3D12
int d3d12_gpu_index;
#endif
#ifdef HAVE_WINDOW_OFFSET
int video_window_offset_x;
int video_window_offset_y;
#endif
int content_favorites_size;
} ints;

View File

@ -3316,6 +3316,14 @@ MSG_HASH(
MENU_ENUM_LABEL_VIDEO_MONITOR_INDEX,
"video_monitor_index"
)
MSG_HASH(
MENU_ENUM_LABEL_VIDEO_WINDOW_OFFSET_X,
"video_window_offset_x"
)
MSG_HASH(
MENU_ENUM_LABEL_VIDEO_WINDOW_OFFSET_Y,
"video_window_offset_y"
)
MSG_HASH(
MENU_ENUM_LABEL_VIDEO_POST_FILTER_RECORD,
"video_post_filter_record"

View File

@ -1514,6 +1514,22 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_VIDEO_GPU_INDEX,
"Select which graphics card to use."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_OFFSET_X,
"Screen Horizontal Offset"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_VIDEO_WINDOW_OFFSET_X,
"Forces a certain offset horizontally to the video. The offset is applied globaly."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_OFFSET_Y,
"Screen Vertical Offset"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_VIDEO_WINDOW_OFFSET_Y,
"Forces a certain offset vertically to the video. The offset is applied globaly."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE,
"Vertical Refresh Rate"

View File

@ -935,6 +935,11 @@ DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_overscan_correction_top, ME
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_overscan_correction_bottom, MENU_ENUM_SUBLABEL_VIDEO_OVERSCAN_CORRECTION_BOTTOM)
#endif
#if defined(HAVE_WINDOW_OFFSET)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_window_offset_x, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_OFFSET_X)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_video_window_offset_y, MENU_ENUM_SUBLABEL_VIDEO_WINDOW_OFFSET_Y)
#endif
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_show_sublabels, MENU_ENUM_SUBLABEL_PLAYLIST_SHOW_SUBLABELS)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_playlist_show_entry_idx, MENU_ENUM_SUBLABEL_PLAYLIST_SHOW_ENTRY_IDX)
DEFAULT_SUBLABEL_MACRO(action_bind_sublabel_menu_rgui_border_filler_enable, MENU_ENUM_SUBLABEL_MENU_RGUI_BORDER_FILLER_ENABLE)
@ -3763,6 +3768,14 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_VIDEO_MONITOR_INDEX:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_monitor_index);
break;
#if defined(HAVE_WINDOW_OFFSET)
case MENU_ENUM_LABEL_VIDEO_WINDOW_OFFSET_X:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_window_offset_x);
break;
case MENU_ENUM_LABEL_VIDEO_WINDOW_OFFSET_Y:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_window_offset_y);
break;
#endif
case MENU_ENUM_LABEL_LOG_VERBOSITY:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_log_verbosity);
break;
@ -4241,6 +4254,14 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_VIDEO_OVERSCAN_CORRECTION_BOTTOM:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_overscan_correction_bottom);
break;
#endif
#if defined(HAVE_WINDOW_OFFSET)
case MENU_ENUM_SUBLABEL_VIDEO_WINDOW_OFFSET_X:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_window_offset_x);
break;
case MENU_ENUM_SUBLABEL_VIDEO_WINDOW_OFFSET_Y:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_video_window_offset_y);
break;
#endif
case MENU_ENUM_LABEL_CHEAT_APPLY_AFTER_LOAD:
#ifdef HAVE_CHEATS

View File

@ -7904,7 +7904,17 @@ unsigned menu_displaylist_build_list(
PARSE_ACTION, false) == 0)
count++;
}
#if defined(HAVE_WINDOW_OFFSET)
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_VIDEO_WINDOW_OFFSET_X,
PARSE_ONLY_INT, false) == 0)
count++;
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_VIDEO_WINDOW_OFFSET_Y,
PARSE_ONLY_INT, false) == 0)
count++;
#endif
if (MENU_DISPLAYLIST_PARSE_SETTINGS_ENUM(list,
MENU_ENUM_LABEL_PAL60_ENABLE,
PARSE_ONLY_BOOL, false) == 0)

View File

@ -11405,6 +11405,34 @@ static bool setting_append_list(
parent_group);
}
#if defined(HAVE_WINDOW_OFFSET)
CONFIG_INT(
list, list_info,
&settings->ints.video_window_offset_x,
MENU_ENUM_LABEL_VIDEO_WINDOW_OFFSET_X,
MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_OFFSET_X,
DEFAULT_WINDOW_OFFSET_X,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, -24, 24, 1, true, true);
CONFIG_INT(
list, list_info,
&settings->ints.video_window_offset_y,
MENU_ENUM_LABEL_VIDEO_WINDOW_OFFSET_Y,
MENU_ENUM_LABEL_VALUE_VIDEO_WINDOW_OFFSET_Y,
DEFAULT_WINDOW_OFFSET_Y,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
menu_settings_list_current_add_range(list, list_info, -24, 24, 1, true, true);
#endif
CONFIG_UINT(
list, list_info,
&custom_vp->width,

View File

@ -1088,6 +1088,8 @@ enum msg_hash_enums
MENU_LABEL(VIDEO_FULLSCREEN),
MENU_LABEL(VIDEO_MONITOR_INDEX),
MENU_LABEL(VIDEO_WINDOW_SCALE),
MENU_LABEL(VIDEO_WINDOW_OFFSET_X),
MENU_LABEL(VIDEO_WINDOW_OFFSET_Y),
MENU_LABEL(VIDEO_REFRESH_RATE),
MENU_LABEL(VIDEO_REFRESH_RATE_AUTO),
MENU_LABEL(VIDEO_REFRESH_RATE_POLLED),