mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Add support for loading at3plusdecoder.so on Android. Make sure the .so files are at /PSP/libs/armeabi-v7a and/or /PSP/libs/armeabi on your Android external storage.
This commit is contained in:
parent
546b6c0fca
commit
f9af7007d2
2 changed files with 29 additions and 1 deletions
|
@ -6,6 +6,13 @@
|
|||
#endif // _WIN32
|
||||
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "Core/Config.h"
|
||||
|
||||
extern std::string externalDirectory;
|
||||
|
||||
namespace Atrac3plus_Decoder {
|
||||
|
||||
|
@ -39,13 +46,32 @@ namespace Atrac3plus_Decoder {
|
|||
return -1;
|
||||
}
|
||||
#else
|
||||
std::string filename = "at3plusdecoder.so";
|
||||
|
||||
#if defined(ANDROID) && defined(ARM)
|
||||
|
||||
#if ARMEABI_V7A
|
||||
filename = g_Config.memCardDirectory + "PSP/libs/armeabi-v7a/lib" + filename;
|
||||
#else
|
||||
filename = g_Config.memCardDirectory + "PSP/libs/armeabi/lib" + filename;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
ILOG("Attempting to load atrac3plus decoder from %s", filename.c_str());
|
||||
// TODO: from which directory on Android?
|
||||
so = dlopen("at3plusdecoder.so", RTLD_LAZY);
|
||||
so = dlopen(filename.c_str(), RTLD_LAZY);
|
||||
if (so) {
|
||||
frame_decoder = (ATRAC3PLUS_DECODEFRAME)dlsym(so, "Atrac3plusDecoder_decodeFrame");
|
||||
open_context = (ATRAC3PLUS_OPENCONTEXT)dlsym(so, "Atrac3plusDecoder_openContext");
|
||||
close_context = (ATRAC3PLUS_CLOSECONTEXT)dlsym(so, "Atrac3plusDecoder_closeContext");
|
||||
ILOG("Successfully loaded atrac3plus decoder from %s", filename.c_str());
|
||||
if (!frame_decoder || !open_context || !close_context) {
|
||||
ILOG("Found atrac3plus decoder at %s but failed to load functions", filename.c_str());
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
ELOG("Failed to load atrac3plus decoder from %s", filename.c_str());
|
||||
return -1;
|
||||
}
|
||||
#endif // _WIN32
|
||||
|
|
|
@ -46,6 +46,7 @@ LOCAL_LDLIBS += $(LOCAL_PATH)/../../ffmpeg/android/armv7/lib/libswresample.a
|
|||
LOCAL_LDLIBS += $(LOCAL_PATH)/../../ffmpeg/android/armv7/lib/libswscale.a
|
||||
LOCAL_LDLIBS += $(LOCAL_PATH)/../../ffmpeg/android/armv7/lib/libavutil.a
|
||||
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../ffmpeg/android/armv7/include
|
||||
LOCAL_CFLAGS += -DARMEABI_V7A
|
||||
endif
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi)
|
||||
LOCAL_LDLIBS += $(LOCAL_PATH)/../../ffmpeg/android/armv6/lib/libavformat.a
|
||||
|
@ -54,6 +55,7 @@ LOCAL_LDLIBS += $(LOCAL_PATH)/../../ffmpeg/android/armv6/lib/libswresample.a
|
|||
LOCAL_LDLIBS += $(LOCAL_PATH)/../../ffmpeg/android/armv6/lib/libswscale.a
|
||||
LOCAL_LDLIBS += $(LOCAL_PATH)/../../ffmpeg/android/armv6/lib/libavutil.a
|
||||
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../ffmpeg/android/armv6/include
|
||||
LOCAL_CFLAGS += -DARMEABI
|
||||
endif
|
||||
|
||||
# $(SRC)/Core/EmuThread.cpp \
|
||||
|
|
Loading…
Add table
Reference in a new issue