[record] add recording threads setting

This commit is contained in:
radius 2018-11-25 15:41:26 -05:00
parent f9c12866bf
commit 665be01b6b
8 changed files with 46 additions and 14 deletions

View file

@ -125,6 +125,10 @@ static const unsigned window_height = 720;
static const unsigned fullscreen_x = 0;
static const unsigned fullscreen_y = 0;
/* Number of threads to use for video recording */
static const unsigned video_record_threads = 2;
/* Amount of transparency to use for the main window.
* 1 is the most transparent while 100 is opaque.
*/

View file

@ -1676,6 +1676,8 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("video_windowed_position_width", &settings->uints.window_position_width, true, window_width, false);
SETTING_UINT("video_windowed_position_height", &settings->uints.window_position_height, true, window_height, false);
SETTING_UINT("video_record_threads", &settings->uints.video_record_threads, true, video_record_threads, false);
*size = count;
return tmp;

View file

@ -443,6 +443,8 @@ typedef struct settings
unsigned window_position_y;
unsigned window_position_width;
unsigned window_position_height;
unsigned video_record_threads;
} uints;
struct

View file

@ -3206,6 +3206,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_SCALE,
"Windowed Scale"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_RECORD_THREADS,
"Recording Threads"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_VIDEO_SCALE_INTEGER,
"Integer Scale"

View file

@ -7316,6 +7316,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
MENU_ENUM_LABEL_STREAMING_MODE,
PARSE_ONLY_UINT, false) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_VIDEO_RECORD_THREADS,
PARSE_ONLY_UINT, true) == 0)
count++;
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_STREAMING_TITLE,
PARSE_ONLY_STRING, false) == 0)

View file

@ -336,16 +336,16 @@ static void setting_get_string_representation_video_stream_quality(
/* TODO/FIXME - localize this */
switch (*setting->value.target.unsigned_integer)
{
case 5:
case 8:
strlcpy(s, "Custom", len);
break;
case 6:
case 9:
strlcpy(s, "Low", len);
break;
case 7:
case 10:
strlcpy(s, "Medium", len);
break;
case 8:
case 11:
strlcpy(s, "High", len);
break;
}
@ -6759,7 +6759,7 @@ static bool setting_append_list(
(*list)[list_info->index - 1].offset_by = 1;
menu_settings_list_current_add_range(list, list_info, 1, 65536, 1, true, true);
CONFIG_UINT(
CONFIG_UINT(
list, list_info,
&settings->uints.video_stream_quality,
MENU_ENUM_LABEL_VIDEO_STREAM_QUALITY,
@ -6773,7 +6773,6 @@ static bool setting_append_list(
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].get_string_representation =
&setting_get_string_representation_video_stream_quality;
(*list)[list_info->index - 1].offset_by = 5;
menu_settings_list_current_add_range(list, list_info, RECORD_CONFIG_TYPE_STREAMING_CUSTOM, RECORD_CONFIG_TYPE_STREAMING_HIGH_QUALITY, 1, true, true);
CONFIG_PATH(
@ -6804,6 +6803,22 @@ static bool setting_append_list(
general_read_handler);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT);
CONFIG_UINT(
list, list_info,
&settings->uints.video_record_threads,
MENU_ENUM_LABEL_VIDEO_RECORD_THREADS,
MENU_ENUM_LABEL_VALUE_VIDEO_RECORD_THREADS,
video_record_threads,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint_special;
menu_settings_list_current_add_range(list, list_info, 1, 8, 1, true, true);
settings_data_list_current_add_flags(list, list_info, SD_FLAG_LAKKA_ADVANCED);
CONFIG_DIR(
list, list_info,
global->record.output_dir,

View file

@ -758,6 +758,7 @@ enum msg_hash_enums
MENU_LABEL(VIDEO_FORCE_SRGB_DISABLE),
MENU_LABEL(VIDEO_ROTATION),
MENU_LABEL(VIDEO_SCALE),
MENU_LABEL(VIDEO_RECORD_THREADS),
MENU_LABEL(VIDEO_SMOOTH),
MENU_LABEL(VIDEO_CROP_OVERSCAN),

View file

@ -564,7 +564,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
{
case RECORD_CONFIG_TYPE_RECORDING_LOW_QUALITY:
case RECORD_CONFIG_TYPE_STREAMING_LOW_QUALITY:
params->threads = 2;
params->threads = settings->uints.video_record_threads;
params->frame_drop_ratio = 1;
params->audio_enable = true;
params->audio_global_quality = 75;
@ -580,7 +580,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
break;
case RECORD_CONFIG_TYPE_RECORDING_MED_QUALITY:
case RECORD_CONFIG_TYPE_STREAMING_MED_QUALITY:
params->threads = 2;
params->threads = settings->uints.video_record_threads;
params->frame_drop_ratio = 1;
params->audio_enable = true;
params->audio_global_quality = 75;
@ -596,7 +596,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
break;
case RECORD_CONFIG_TYPE_RECORDING_HIGH_QUALITY:
case RECORD_CONFIG_TYPE_STREAMING_HIGH_QUALITY:
params->threads = 2;
params->threads = settings->uints.video_record_threads;
params->frame_drop_ratio = 1;
params->audio_enable = true;
params->audio_global_quality = 100;
@ -611,7 +611,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
av_dict_set(&params->audio_opts, "audio_global_quality", "100", 0);
break;
case RECORD_CONFIG_TYPE_RECORDING_LOSSLESS_QUALITY:
params->threads = 2;
params->threads = settings->uints.video_record_threads;
params->frame_drop_ratio = 1;
params->audio_enable = true;
params->audio_global_quality = 80;
@ -626,7 +626,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
av_dict_set(&params->audio_opts, "audio_global_quality", "80", 0);
break;
case RECORD_CONFIG_TYPE_RECORDING_WEBM_FAST:
params->threads = 2;
params->threads = settings->uints.video_record_threads;
params->frame_drop_ratio = 1;
params->audio_enable = true;
params->audio_global_quality = 50;
@ -640,7 +640,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
av_dict_set(&params->audio_opts, "audio_global_quality", "50", 0);
break;
case RECORD_CONFIG_TYPE_RECORDING_WEBM_HIGH_QUALITY:
params->threads = 2;
params->threads = settings->uints.video_record_threads;
params->frame_drop_ratio = 1;
params->audio_enable = true;
params->audio_global_quality = 75;
@ -654,7 +654,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
av_dict_set(&params->audio_opts, "audio_global_quality", "75", 0);
break;
case RECORD_CONFIG_TYPE_RECORDING_GIF:
params->threads = 2;
params->threads = settings->uints.video_record_threads;
params->frame_drop_ratio = 1;
params->audio_enable = false;
params->audio_global_quality = 0;
@ -667,7 +667,7 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
av_dict_set(&params->audio_opts, "audio_global_quality", "0", 0);
break;
case RECORD_CONFIG_TYPE_STREAMING_NETPLAY:
params->threads = 2;
params->threads = settings->uints.video_record_threads;
params->frame_drop_ratio = 1;
params->audio_enable = true;
params->audio_global_quality = 50;