大家好,
请问,有谁用NDK编译开源库并用Android App(java)调用测试过的?网上关于这方面的资料好少,都是分析那几个sample。NDK本身目的就是为了使用开源库的,但是很难找到这方面的资料。要么就是只能找到如何编译得到so的。有谁有这方面的经验?我现在试着编译了几个开源库,基本都失败了。现在jpeg编译得到了so,但是调用也是失败。NDK的资料真的很难找啊!求助。
谢谢。
------解决方案--------------------
http://blog.chinaunix.net/space.php?uid=8272118&do=blog&cuid=1998532
楼主看下上面的做法
一般开源项目都会说本项目的编译方法的吧
------解决方案--------------------
在Stackoverflow上搜到一个,希望对你有帮助,地址是http://stackoverflow.com/questions/4725773/ffmpeg-on-android
下面是被采纳的答案:
Here are the steps I went through in getting ffmpeg to work on Android:
Build static libraries of ffmpeg for Android. This was achieved by building olvaffe's ffmpeg android port (libffmpeg) using the Android Build System. Simply place the sources under /external and make away. You'll need to extract bionic(libc) and zlib(libz) from the Android build as well, as ffmpeg libraries depend on them.
Create a dynamic library wrapping ffmpeg functionality using the Android NDK. There's a lot of documentation out there on how to work with the NDK. Basically you'll need to write some C/C++ code to export the functionality you need out of ffmpeg into a library java can interact with through JNI. The NDK allows you to easily link against the static libraries you've generated in step 1, just add a line similar to this to Android.mk: LOCAL_STATIC_LIBRARIES := libavcodec libavformat libavutil libc libz
Use the ffmpeg-wrapping dynamic library from your java sources. There's enough documentation on JNI out there, you should be fine.
Regarding using ffmpeg for playback, there are many examples (the ffmpeg binary itself is a good example), here's a basic tutorial. The best documentation can be found in the headers.
Good luck :)