mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-23 16:09:47 +00:00
[record] add settings for video scale factor
This commit is contained in:
parent
554ad5a494
commit
58b7621559
@ -1621,6 +1621,8 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("video_stream_port", &settings->uints.video_stream_port, true, RARCH_STREAM_DEFAULT_PORT, false);
|
||||
SETTING_UINT("video_record_quality", &settings->uints.video_record_quality, true, RECORD_CONFIG_TYPE_RECORDING_LOSSLESS_QUALITY, false);
|
||||
SETTING_UINT("video_stream_quality", &settings->uints.video_stream_quality, true, RECORD_CONFIG_TYPE_STREAMING_LOW_QUALITY, false);
|
||||
SETTING_UINT("video_record_scale_factor", &settings->uints.video_record_scale_factor, true, 1, false);
|
||||
SETTING_UINT("video_stream_scale_factor", &settings->uints.video_stream_scale_factor, true, 1, false);
|
||||
#endif
|
||||
|
||||
*size = count;
|
||||
|
@ -390,6 +390,8 @@ typedef struct settings
|
||||
unsigned video_stream_port;
|
||||
unsigned video_record_quality;
|
||||
unsigned video_stream_quality;
|
||||
unsigned video_record_scale_factor;
|
||||
unsigned video_stream_scale_factor;
|
||||
|
||||
unsigned menu_thumbnails;
|
||||
unsigned menu_left_thumbnails;
|
||||
|
@ -550,13 +550,12 @@ static bool ffmpeg_init_video(ffmpeg_t *handle)
|
||||
|
||||
static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned preset)
|
||||
{
|
||||
char buf[256];
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
switch (preset)
|
||||
{
|
||||
case RECORD_CONFIG_TYPE_RECORDING_LOW_QUALITY:
|
||||
case RECORD_CONFIG_TYPE_STREAMING_LOW_QUALITY:
|
||||
params->scale_factor = 1;
|
||||
params->threads = 1;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
@ -573,7 +572,6 @@ 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->scale_factor = 1;
|
||||
params->threads = 1;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
@ -590,7 +588,6 @@ 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->scale_factor = 1;
|
||||
params->threads = 1;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
@ -606,7 +603,6 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
|
||||
av_dict_set(¶ms->audio_opts, "audio_global_quality", "100", 0);
|
||||
break;
|
||||
case RECORD_CONFIG_TYPE_RECORDING_LOSSLESS_QUALITY:
|
||||
params->scale_factor = 1;
|
||||
params->threads = 1;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
@ -622,7 +618,6 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
|
||||
av_dict_set(¶ms->audio_opts, "audio_global_quality", "100", 0);
|
||||
break;
|
||||
case RECORD_CONFIG_TYPE_STREAMING_NETPLAY:
|
||||
params->scale_factor = 1;
|
||||
params->threads = 1;
|
||||
params->frame_drop_ratio = 1;
|
||||
params->audio_enable = true;
|
||||
@ -642,11 +637,28 @@ static bool ffmpeg_init_config_common(struct ff_config_param *params, unsigned p
|
||||
}
|
||||
|
||||
if (preset <= RECORD_CONFIG_TYPE_RECORDING_LOSSLESS_QUALITY)
|
||||
{
|
||||
if (!settings->bools.video_gpu_record)
|
||||
params->scale_factor = settings->uints.video_record_scale_factor > 0 ?
|
||||
settings->uints.video_record_scale_factor : 1;
|
||||
else
|
||||
params->scale_factor = 1;
|
||||
strlcpy(params->format, "matroska", sizeof(params->format));
|
||||
}
|
||||
else if (preset <= RECORD_CONFIG_TYPE_STREAMING_HIGH_QUALITY)
|
||||
{
|
||||
if (!settings->bools.video_gpu_record)
|
||||
params->scale_factor = settings->uints.video_stream_scale_factor > 0 ?
|
||||
settings->uints.video_stream_scale_factor : 1;
|
||||
else
|
||||
params->scale_factor = 1;
|
||||
strlcpy(params->format, "flv", sizeof(params->format));
|
||||
}
|
||||
else
|
||||
{
|
||||
params->scale_factor = 1;
|
||||
strlcpy(params->format, "flv", sizeof(params->format));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user