(record_ffmpeg) No more settings_t dependency

This commit is contained in:
twinaphex 2020-02-13 21:48:52 +01:00
parent 9c37356267
commit 950f6bb752
3 changed files with 21 additions and 8 deletions

View File

@ -65,7 +65,6 @@ extern "C" {
} }
#endif #endif
#include "../../configuration.h"
#include "../../retroarch.h" #include "../../retroarch.h"
#include "../../verbosity.h" #include "../../verbosity.h"
@ -1042,7 +1041,6 @@ static void ffmpeg_free(void *data)
static void *ffmpeg_new(const struct record_params *params) static void *ffmpeg_new(const struct record_params *params)
{ {
settings_t *settings = config_get_ptr();
ffmpeg_t *handle = (ffmpeg_t*)calloc(1, sizeof(*handle)); ffmpeg_t *handle = (ffmpeg_t*)calloc(1, sizeof(*handle));
if (!handle) if (!handle)
return NULL; return NULL;
@ -1065,11 +1063,11 @@ static void *ffmpeg_new(const struct record_params *params)
ffmpeg_init_config_common( ffmpeg_init_config_common(
&handle->config, &handle->config,
params->preset, params->preset,
settings->bools.video_gpu_record, params->video_gpu_record,
settings->uints.video_record_scale_factor, params->video_record_scale_factor,
settings->uints.video_stream_scale_factor, params->video_stream_scale_factor,
settings->uints.streaming_mode, params->streaming_mode,
settings->uints.video_record_threads params->video_record_threads
); );
break; break;
} }
@ -1082,7 +1080,7 @@ static void *ffmpeg_new(const struct record_params *params)
if (handle->config.audio_enable && if (handle->config.audio_enable &&
!ffmpeg_init_audio(handle, !ffmpeg_init_audio(handle,
settings->arrays.audio_resampler)) params->audio_resampler))
goto error; goto error;
if (!ffmpeg_init_muxer_post(handle)) if (!ffmpeg_init_muxer_post(handle))

View File

@ -11988,6 +11988,13 @@ static bool recording_init(void)
} }
} }
params.audio_resampler = settings->arrays.audio_resampler;
params.video_gpu_record = settings->bools.video_gpu_record;
params.video_record_scale_factor = settings->uints.video_record_scale_factor;
params.video_stream_scale_factor = settings->uints.video_stream_scale_factor;
params.video_record_threads = settings->uints.video_record_threads;
params.streaming_mode = settings->uints.streaming_mode;
params.out_width = av_info->geometry.base_width; params.out_width = av_info->geometry.base_width;
params.out_height = av_info->geometry.base_height; params.out_height = av_info->geometry.base_height;
params.fb_width = av_info->geometry.max_width; params.fb_width = av_info->geometry.max_width;

View File

@ -660,6 +660,14 @@ struct record_params
/* Path to config. Optional. */ /* Path to config. Optional. */
const char *config; const char *config;
bool video_gpu_record;
unsigned video_record_scale_factor;
unsigned video_stream_scale_factor;
unsigned video_record_threads;
unsigned streaming_mode;
const char *audio_resampler;
}; };
struct record_video_data struct record_video_data