mirror of
https://github.com/libretro/RetroArch
synced 2025-03-31 10:20:41 +00:00
Merge pull request #4312 from Aaahh/patch-1
(ffmpeg core) Add GLFFT toggle
This commit is contained in:
commit
fbcd7739d9
@ -116,6 +116,7 @@ static size_t attachments_size;
|
|||||||
|
|
||||||
#ifdef HAVE_GL_FFT
|
#ifdef HAVE_GL_FFT
|
||||||
static glfft_t *fft;
|
static glfft_t *fft;
|
||||||
|
static bool glfft;
|
||||||
unsigned fft_width;
|
unsigned fft_width;
|
||||||
unsigned fft_height;
|
unsigned fft_height;
|
||||||
unsigned fft_multisample;
|
unsigned fft_multisample;
|
||||||
@ -253,7 +254,7 @@ void CORE_PREFIX(retro_get_system_av_info)(struct retro_system_av_info *info)
|
|||||||
info->timing.sample_rate = actx[0] ? media.sample_rate : 32000.0;
|
info->timing.sample_rate = actx[0] ? media.sample_rate : 32000.0;
|
||||||
|
|
||||||
#ifdef HAVE_GL_FFT
|
#ifdef HAVE_GL_FFT
|
||||||
if (audio_streams_num > 0 && video_stream < 0)
|
if (audio_streams_num > 0 && video_stream < 0 && glfft)
|
||||||
{
|
{
|
||||||
width = fft_width;
|
width = fft_width;
|
||||||
height = fft_height;
|
height = fft_height;
|
||||||
@ -274,6 +275,7 @@ void CORE_PREFIX(retro_set_environment)(retro_environment_t cb)
|
|||||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||||
{ "ffmpeg_temporal_interp", "Temporal Interpolation; enabled|disabled" },
|
{ "ffmpeg_temporal_interp", "Temporal Interpolation; enabled|disabled" },
|
||||||
#ifdef HAVE_GL_FFT
|
#ifdef HAVE_GL_FFT
|
||||||
|
{ "ffmpeg_fft", "GLFFT; enabled|disabled" },
|
||||||
{ "ffmpeg_fft_resolution", "GLFFT Resolution; 1280x720|1920x1080|640x360|320x180" },
|
{ "ffmpeg_fft_resolution", "GLFFT Resolution; 1280x720|1920x1080|640x360|320x180" },
|
||||||
{ "ffmpeg_fft_multisample", "GLFFT Multisample; 1x|2x|4x" },
|
{ "ffmpeg_fft_multisample", "GLFFT Multisample; 1x|2x|4x" },
|
||||||
#endif
|
#endif
|
||||||
@ -330,6 +332,7 @@ static void check_variables(void)
|
|||||||
struct retro_variable var = {0};
|
struct retro_variable var = {0};
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_GL_FFT
|
#ifdef HAVE_GL_FFT
|
||||||
|
struct retro_variable fft_on_var = {0};
|
||||||
struct retro_variable fft_var = {0};
|
struct retro_variable fft_var = {0};
|
||||||
struct retro_variable fft_ms_var = {0};
|
struct retro_variable fft_ms_var = {0};
|
||||||
#endif
|
#endif
|
||||||
@ -346,6 +349,16 @@ static void check_variables(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GL_FFT
|
#ifdef HAVE_GL_FFT
|
||||||
|
fft_on_var.key = "ffmpeg_fft";
|
||||||
|
|
||||||
|
if (CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &fft_on_var) && fft_on_var.value)
|
||||||
|
{
|
||||||
|
if (!strcmp(fft_on_var.value, "enabled"))
|
||||||
|
glfft = true;
|
||||||
|
else if (!strcmp(fft_on_var.value, "disabled"))
|
||||||
|
glfft = false;
|
||||||
|
}
|
||||||
|
|
||||||
fft_var.key = "ffmpeg_fft_resolution";
|
fft_var.key = "ffmpeg_fft_resolution";
|
||||||
|
|
||||||
fft_width = 1280;
|
fft_width = 1280;
|
||||||
@ -441,6 +454,7 @@ void CORE_PREFIX(retro_run)(void)
|
|||||||
int seek_frames = 0;
|
int seek_frames = 0;
|
||||||
bool updated = false;
|
bool updated = false;
|
||||||
#ifdef HAVE_GL_FFT
|
#ifdef HAVE_GL_FFT
|
||||||
|
unsigned old_glfft = glfft ;
|
||||||
unsigned old_fft_width = fft_width;
|
unsigned old_fft_width = fft_width;
|
||||||
unsigned old_fft_height = fft_height;
|
unsigned old_fft_height = fft_height;
|
||||||
unsigned old_fft_multisample = fft_multisample;
|
unsigned old_fft_multisample = fft_multisample;
|
||||||
@ -463,6 +477,11 @@ void CORE_PREFIX(retro_run)(void)
|
|||||||
|
|
||||||
if (fft && (old_fft_multisample != fft_multisample))
|
if (fft && (old_fft_multisample != fft_multisample))
|
||||||
glfft_init_multisample(fft, fft_width, fft_height, fft_multisample);
|
glfft_init_multisample(fft, fft_width, fft_height, fft_multisample);
|
||||||
|
|
||||||
|
if (fft && (old_glfft != glfft))
|
||||||
|
glfft_free(fft);
|
||||||
|
fft = NULL;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CORE_PREFIX(input_poll_cb)();
|
CORE_PREFIX(input_poll_cb)();
|
||||||
@ -1398,7 +1417,7 @@ static void context_reset(void)
|
|||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
#ifdef HAVE_GL_FFT
|
#ifdef HAVE_GL_FFT
|
||||||
if (audio_streams_num > 0 && video_stream < 0)
|
if (audio_streams_num > 0 && video_stream < 0 && glfft)
|
||||||
{
|
{
|
||||||
fft = glfft_new(11, hw_render.get_proc_address);
|
fft = glfft_new(11, hw_render.get_proc_address);
|
||||||
if (fft)
|
if (fft)
|
||||||
@ -1603,7 +1622,7 @@ bool CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_GL_FFT
|
#ifdef HAVE_GL_FFT
|
||||||
is_glfft = video_stream < 0 && audio_streams_num > 0;
|
is_glfft = audio_streams_num > 0 && video_stream < 0 && glfft;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (video_stream >= 0 || is_glfft)
|
if (video_stream >= 0 || is_glfft)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user