From 7b1f57b1cd772d4716c90935649b5bd8f3809b27 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 20 Nov 2015 15:14:12 +0100 Subject: [PATCH] Add RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE --- gfx/video_driver.c | 11 ++++------- gfx/video_driver.h | 3 +-- libretro_version_1.c | 2 +- record/record_driver.c | 2 +- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index f09c97a86f..ac508b23f1 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -1180,13 +1180,6 @@ bool video_driver_frame_filter_is_32bit(void) return video_state.filter.out_rgb32; } -bool video_driver_frame_filter_alive(void) -{ - if (video_state.filter.filter) - return true; - return false; -} - rarch_softfilter_t *video_driver_frame_filter_get_ptr(void) { return video_state.filter.filter; @@ -1220,6 +1213,10 @@ bool video_driver_ctl(enum rarch_display_ctl_state state, void *data) return true; } break; + case RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE: + if (video_state.filter.filter) + return true; + return false; case RARCH_DISPLAY_CTL_NONE: default: break; diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 1cb73517d9..9b2365a2c9 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -221,6 +221,7 @@ enum rarch_display_type enum rarch_display_ctl_state { RARCH_DISPLAY_CTL_NONE = 0, + RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE, RARCH_DISPLAY_CTL_GET_FRAME_COUNT }; @@ -360,8 +361,6 @@ bool video_driver_frame_filter(const void *data, unsigned *output_width, unsigned *output_height, unsigned *output_pitch); -bool video_driver_frame_filter_alive(void); - bool video_driver_frame_filter_is_32bit(void); rarch_softfilter_t *video_driver_frame_filter_get_ptr(void); diff --git a/libretro_version_1.c b/libretro_version_1.c index a93febf10e..5b0b79e383 100644 --- a/libretro_version_1.c +++ b/libretro_version_1.c @@ -80,7 +80,7 @@ static void video_frame(const void *data, unsigned width, * but we really need to do processing before blocking on VSync * for best possible scheduling. */ - if ((!video_driver_frame_filter_alive() + if ((!video_driver_ctl(RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE, NULL) || !settings->video.post_filter_record || !data || global->record.gpu_buffer) ) diff --git a/record/record_driver.c b/record/record_driver.c index e6dc6c540e..3a09bc8e71 100644 --- a/record/record_driver.c +++ b/record/record_driver.c @@ -365,7 +365,7 @@ bool recording_init(void) else params.aspect_ratio = (float)params.out_width / params.out_height; - if (settings->video.post_filter_record && video_driver_frame_filter_alive()) + if (settings->video.post_filter_record && video_driver_ctl(RARCH_DISPLAY_CTL_FRAME_FILTER_ALIVE, NULL)) { unsigned max_width = 0; unsigned max_height = 0;