Flac Extension for Exoplayer

时间:2019-03-19 06:44:49

标签: android exoplayer flac

我正在尝试在我的项目中编译flac扩展以与Android Studio,ExoPlayer一起使用。我尝试按照ExoPlayer自述文件中的说明进行操作,但是出现以下错误:

cd ExoPlayer
EXOPLAYER_ROOT="$(pwd)"
FLAC_EXT_PATH="${EXOPLAYER_ROOT}/extensions/flac/src/main"
NDK_PATH="~/Downloads/android-ndk-r17c"
cd "${FLAC_EXT_PATH}/jni"

mv ~/Downloads/flac-1.3.2 flac

${NDK_PATH}/ndk-build APP_ABI=all -j4

...:~/Downloads/ExoPlayer/extensions/flac/src/main/jni$     

NDK_PATH=.../Downloads/android-ndk-r17c

...:~/Downloads/ExoPlayer/extensions/flac/src/main/jni$ ${NDK_PATH}/ndk-build APP_ABI=all -j4

Android NDK: WARNING: APP_PLATFORM android-14 is higher than android:minSdkVersion 1 in .../Downloads/ExoPlayer/extensions/flac/src/main/AndroidManifest.xml. NDK binaries will *not* be compatible with devices older than android-14. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information.    

Android NDK: WARNING: APP_STL gnustl_static is deprecated and will be removed in the next release. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more information.    
    [arm64-v8a] Compile        : flacJNI <= format.c
    [arm64-v8a] Compile        : flacJNI <= stream_encoder_framing.c
    [arm64-v8a] Compile        : flacJNI <= stream_encoder_intrin_avx2.c
    [arm64-v8a] Compile        : flacJNI <= stream_encoder_intrin_sse2.c
    [arm64-v8a] Compile        : flacJNI <= stream_encoder_intrin_ssse3.c
    [arm64-v8a] Compile        : flacJNI <= window.c
    .../Downloads/ExoPlayer/extensions/flac/src/main/jni/flac/src/libFLAC/format.c:47:45: error: 
          use of undeclared identifier 'VERSION'
    FLAC_API const char *FLAC__VERSION_STRING = VERSION;
                                                ^
    .../Downloads/ExoPlayer/extensions/flac/src/main/jni/flac/src/libFLAC/format.c:49:64: error: 
          expected ';' after top level declarator
    FLAC_API const char *FLAC__VENDOR_STRING = "reference libFLAC " VERSION ...
                                                                   ^
                                                                   ;
    2 errors generated.
    make: *** [/home/philip/Downloads/ExoPlayer/extensions/flac/src/main/obj/local/arm64-v8a/objs/flacJNI/flac/src/libFLAC/format.o] Error 1
    make: *** Waiting for unfinished jobs....

如何使它正常工作?谢谢。

1 个答案:

答案 0 :(得分:0)

要获取flac扩展以在Android Studio中进行编译,我需要转到:

工具| SDKManager | SDKTools和已检查的Cmake