The overall call logic is:
1. Compile the FFMPEG Library
2. Use JNI to write C code, which must contain the corresponding FFMPEG header file
3. Write the corresponding Android. mk file, which specifies the C code to be compiled and the dynamic library to be linked.
4. Execute ndk-build to generate the corresponding JNI Library
5. Create the andorid Java program. The corresponding FFMPEG library of loadlibrary and the jni library just generated in the code
6. Declare native functions using static methods. These functions have been implemented in C language written by JNI.
The steps are as follows:
1 will be in the 32-bit Ubuntu
Libffmpeg compiled in 0.8.1 of the latest FFMPEG version for Android ndk R6 in 11.04. so file copy to/root/develop/android-ndk-r6/platforms/Android-8/arch-arm/usr/lib directory, if android2.3 is used, you also need to have a copy to the/root/develop/android-ndk-r6/platforms/Android-9/arch-arm/usr/lib directory.
2. Go to the samples directory of Android ndk R6 and modify it based on the simplest hello-JNI. Because we need to use the header file when calling the FFMPEG library method. Here we copy all the code from the previously compiled libffmpeg. So file to the/root/develop/android-ndk-r6/samples/directory and change the directory name to FFMPEG
3 modify hello-jni.c files
Help
12345678910111213141516171819202122232425262728293031323334353637 |