mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
Start work on using OpenSL conditionally (to still support Android 2.2)
This commit is contained in:
1 parent
aaa15177e0
commit
3e05162dc0
7 files changed
+278
-6
No files matched your search
@@ -0,0 +1,34 @@
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "android/native_audio.h"
|
||||
#include "android/native-audio-so.h"
|
||||
|
||||
static void *so;
|
||||
static OpenSLWrap_Init_T init_func;
|
||||
static OpenSLWrap_Shutdown_T shutdown_func;
|
||||
|
||||
bool AndroidAudio_Init(AndroidAudioCallback cb) {
|
||||
ILOG("Loading native audio library...");
|
||||
so = dlopen("libnative_audio.so", RTLD_NOW);
|
||||
if (!so) {
|
||||
ELOG("Failed to find native audio library");
|
||||
return false;
|
||||
}
|
||||
init_func = (OpenSLWrap_Init_T)dlsym(so, "OpenSLWrap_Init");
|
||||
shutdown_func = (OpenSLWrap_Shutdown_T)dlsym(so, "OpenSLWrap_Shutdown");
|
||||
|
||||
ILOG("Calling OpenSLWrap_Init_T...");
|
||||
bool init_retval = init_func(cb);
|
||||
ILOG("Returned from OpenSLWrap_Init_T");
|
||||
return init_retval;
|
||||
}
|
||||
|
||||
|
||||
void AndroidAudio_Shutdown() {
|
||||
ILOG("Calling OpenSLWrap_Shutdown_T...");
|
||||
shutdown_func();
|
||||
ILOG("Returned from OpenSLWrap_Shutdown_T");
|
||||
dlclose(so);
|
||||
so = 0;
|
||||
}
|
||||
Reference in new issue
Block a user