diff --git a/audio/resamplers/cc_resampler.c b/audio/resamplers/cc_resampler.c index 2f4d1271ef..25f3bcc029 100644 --- a/audio/resamplers/cc_resampler.c +++ b/audio/resamplers/cc_resampler.c @@ -594,4 +594,5 @@ rarch_resampler_t CC_resampler = { resampler_CC_free, RESAMPLER_API_VERSION, "CC", + "cc" }; diff --git a/audio/resamplers/nearest.c b/audio/resamplers/nearest.c index d963c48eb4..421d407937 100644 --- a/audio/resamplers/nearest.c +++ b/audio/resamplers/nearest.c @@ -76,4 +76,5 @@ rarch_resampler_t nearest_resampler = { resampler_nearest_free, RESAMPLER_API_VERSION, "nearest", + "nearest" }; diff --git a/audio/resamplers/resampler.h b/audio/resamplers/resampler.h index 8fe254c002..0366e8d446 100644 --- a/audio/resamplers/resampler.h +++ b/audio/resamplers/resampler.h @@ -66,13 +66,22 @@ struct resampler_data double ratio; }; +/* Bandwidth factor. Will be < 1.0 for downsampling, > 1.0 for upsampling. + * Corresponds to expected resampling ratio. */ +typedef void *(*resampler_init_t)(double bandwidth_mod, + resampler_simd_mask_t mask); + +/* Frees the handle. */ +typedef void (*resampler_free_t)(void *data); + +/* Processes input data. */ +typedef void (*resampler_process_t)(void *_data, struct resampler_data *data); + typedef struct rarch_resampler { - /* Bandwidth factor. Will be < 1.0 for downsampling, > 1.0 for upsampling. - * Corresponds to expected resampling ratio. */ - void *(*init)(double bandwidth_mod, resampler_simd_mask_t mask); - void (*process)(void *re, struct resampler_data *data); - void (*free)(void *re); + resampler_init_t init; + resampler_process_t process; + resampler_free_t free; /* Must be RESAMPLER_API_VERSION */ unsigned api_version; @@ -80,6 +89,9 @@ typedef struct rarch_resampler /* Human readable identifier of implementation. */ const char *ident; + /* Computer-friendly short version of ident. + * Lower case, no spaces and special characters, etc. */ + const char *short_ident; } rarch_resampler_t; typedef struct audio_frame_float diff --git a/audio/resamplers/sinc.c b/audio/resamplers/sinc.c index d4191500c8..126f700177 100644 --- a/audio/resamplers/sinc.c +++ b/audio/resamplers/sinc.c @@ -560,5 +560,6 @@ rarch_resampler_t sinc_resampler = { resampler_sinc_free, RESAMPLER_API_VERSION, "sinc", + "sinc" };