From 73de119a84a7b3a844a5f871d480225cc254dfb0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 26 Sep 2014 16:36:36 +0200 Subject: [PATCH] (Resamplers) Add RESAMPLER_API_VERSION --- audio/resamplers/cc_resampler.c | 1 + audio/resamplers/nearest.c | 1 + audio/resamplers/resampler.h | 8 ++++++++ audio/resamplers/sinc.c | 1 + 4 files changed, 11 insertions(+) diff --git a/audio/resamplers/cc_resampler.c b/audio/resamplers/cc_resampler.c index 031414fee8..2f4d1271ef 100644 --- a/audio/resamplers/cc_resampler.c +++ b/audio/resamplers/cc_resampler.c @@ -592,5 +592,6 @@ rarch_resampler_t CC_resampler = { resampler_CC_init, resampler_CC_process, resampler_CC_free, + RESAMPLER_API_VERSION, "CC", }; diff --git a/audio/resamplers/nearest.c b/audio/resamplers/nearest.c index b86b8b7bbd..d963c48eb4 100644 --- a/audio/resamplers/nearest.c +++ b/audio/resamplers/nearest.c @@ -74,5 +74,6 @@ rarch_resampler_t nearest_resampler = { resampler_nearest_init, resampler_nearest_process, resampler_nearest_free, + RESAMPLER_API_VERSION, "nearest", }; diff --git a/audio/resamplers/resampler.h b/audio/resamplers/resampler.h index 8ebdbc937d..8fe254c002 100644 --- a/audio/resamplers/resampler.h +++ b/audio/resamplers/resampler.h @@ -53,6 +53,8 @@ extern "C" { */ typedef unsigned resampler_simd_mask_t; +#define RESAMPLER_API_VERSION 1 + struct resampler_data { const float *data_in; @@ -71,7 +73,13 @@ typedef struct rarch_resampler void *(*init)(double bandwidth_mod, resampler_simd_mask_t mask); void (*process)(void *re, struct resampler_data *data); void (*free)(void *re); + + /* Must be RESAMPLER_API_VERSION */ + unsigned api_version; + + /* Human readable identifier of implementation. */ const char *ident; + } rarch_resampler_t; typedef struct audio_frame_float diff --git a/audio/resamplers/sinc.c b/audio/resamplers/sinc.c index ff73360ba9..d4191500c8 100644 --- a/audio/resamplers/sinc.c +++ b/audio/resamplers/sinc.c @@ -558,6 +558,7 @@ rarch_resampler_t sinc_resampler = { resampler_sinc_new, resampler_sinc_process, resampler_sinc_free, + RESAMPLER_API_VERSION, "sinc", };