Add getter functions for backend vtables.

This commit is contained in:
David Reid
2026-01-07 09:22:43 +10:00
parent fd74d344c7
commit 882d7329f9
9 changed files with 143 additions and 7 deletions
@@ -2895,6 +2895,12 @@ ma_device_backend_vtable* ma_device_backend_pipewire = &ma_gDeviceBackendVTable_
ma_device_backend_vtable* ma_device_backend_pipewire = NULL;
#endif /* MA_HAS_PIPEWIRE */
MA_API ma_device_backend_vtable* ma_pipewire_get_vtable(void)
{
return ma_device_backend_pipewire;
}
MA_API ma_context_config_pipewire ma_context_config_pipewire_init(void)
{
ma_context_config_pipewire config;
@@ -7,9 +7,6 @@
extern "C" {
#endif
extern ma_device_backend_vtable* ma_device_backend_pipewire;
typedef struct
{
int _unused;
@@ -27,6 +24,10 @@ typedef struct
MA_API ma_device_config_pipewire ma_device_config_pipewire_init(void);
extern ma_device_backend_vtable* ma_device_backend_pipewire;
MA_API ma_device_backend_vtable* ma_pipewire_get_vtable(void);
#ifdef __cplusplus
}
#endif
+5
View File
@@ -685,6 +685,11 @@ ma_device_backend_vtable* ma_device_backend_sdl2 = &ma_gDeviceBackendVTable_SDL2
ma_device_backend_vtable* ma_device_backend_sdl2 = NULL;
#endif /* MA_HAS_SDL2 */
MA_API ma_device_backend_vtable* ma_sdl2_get_vtable(void)
{
return ma_device_backend_sdl2;
}
MA_API ma_context_config_sdl2 ma_context_config_sdl2_init(void)
{
+4 -3
View File
@@ -10,9 +10,6 @@ and device configs.
extern "C" {
#endif
extern ma_device_backend_vtable* ma_device_backend_sdl2;
typedef struct
{
int _unused;
@@ -28,6 +25,10 @@ typedef struct
MA_API ma_device_config_sdl2 ma_device_config_sdl2_init(void);
extern ma_device_backend_vtable* ma_device_backend_sdl2;
MA_API ma_device_backend_vtable* ma_sdl2_get_vtable(void);
#ifdef __cplusplus
}
#endif
@@ -555,4 +555,9 @@ ma_decoding_backend_vtable* ma_decoding_backend_libopus = &ma_gDecodingBackendVT
ma_decoding_backend_vtable* ma_decoding_backend_libopus = NULL;
#endif
MA_API ma_decoding_backend_vtable* ma_libopus_get_vtable(void)
{
return ma_decoding_backend_libopus;
}
#endif /* miniaudio_libopus_c */
@@ -35,6 +35,7 @@ MA_API ma_result ma_libopus_get_length_in_pcm_frames(ma_libopus* pOpus, ma_uint6
/* Decoding backend vtable. This is what you'll plug into ma_decoder_config.pBackendVTables. No user data required. */
extern ma_decoding_backend_vtable* ma_decoding_backend_libopus;
MA_API ma_decoding_backend_vtable* ma_libopus_get_vtable(void);
#ifdef __cplusplus
}
@@ -609,4 +609,9 @@ ma_decoding_backend_vtable* ma_decoding_backend_libvorbis = &ma_gDecodingBackend
ma_decoding_backend_vtable* ma_decoding_backend_libvorbis = NULL;
#endif
MA_API ma_decoding_backend_vtable* ma_libvorbis_get_vtable(void)
{
return ma_decoding_backend_libvorbis;
}
#endif /* miniaudio_libvorbis_c */
@@ -35,6 +35,7 @@ MA_API ma_result ma_libvorbis_get_length_in_pcm_frames(ma_libvorbis* pVorbis, ma
/* Decoding backend vtable. This is what you'll plug into ma_decoder_config.pBackendVTables. No user data required. */
extern ma_decoding_backend_vtable* ma_decoding_backend_libvorbis;
MA_API ma_decoding_backend_vtable* ma_libvorbis_get_vtable(void);
#ifdef __cplusplus
}