PjSip编译 for android
编译Openh264
参考git上的README
切换到openh264目录下
armeabi-v7a版本
make OS=android NDKROOT=$NDK_HOME TARGET=android-27
arm64-v8a版本
make -B OS=android NDKROOT=$NDK_HOME TARGET=android-27 ARCH=arm64 NDKLEVEL=21
编译完后在openh264目录下,头文件在/openh264/codec/api/svc目录下
make OS=android NDKROOT=/usr/local/Android/Sdk/ndk/android-ndk-r13b TARGET=android-24 NDKLEVEL=24 ARCH=arm APP_ABI=armeabi-v7a PREFIX=/home/fwy/pjsip/pjproject/openh264lib install-shared
APP_PLATFORM=android-17 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags --disable-l16-codec --disable-gsm-codec --disable-ilbc-codec
export ANDROID_NDK_ROOT=/usr/local/Android/Sdk/ndk/android-ndk-r13b
export PATH=$ANDROID_NDK_ROOT:$PATH
APP_PLATFORM=android-24 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags --disable-l16-codec --disable-gsm-codec --disable-ilbc-codec --with-openh264=/home/fwy/pjsip/pjproject/openh264lib
APP_PLATFORM=android-24 TARGET_ABI=armeabi-v7a ./configure-android --use-ndk-cflags --disable-l16-codec --disable-gsm-codec --disable-ilbc-codec --with-openh264=/home/fwy/pjsip/pjproject/openh264lib --with-bcg729=/home/fwy/pjsip/pjproject/g729
arm64-v8a
android编译bcg729库
参考PJSIP G.729的支持,依赖于bcg729库。也可以使用bcg729
android编译bcg729库:
git clone git://git.linphone.org/bcg729.git
cd bcg729
cmake -DDEBUG=ON -DCMAKE_TOOLCHAIN_FILE=/usr/local/Android/Sdk/ndk/android-ndk-r13b/build/cmake/android.toolchain.cmake -DCMAKE_INSTALL_PREFIX=./androidlib -DANDROID_NDK=/usr/local/Android/Sdk/ndk/android-ndk-r13b -DANDROID_ABI=armeabi-v7a -DANDROID_TOOLCHAIN=clang -DANDROID_PLATFORM=android-24 -DANDROID_STL=c++_shared
make
make install
cmake -DDEBUG=ON -DCMAKE_INSTALL_PREFIX=./androidlib -DANDROID_NDK=/usr/local/Android/Sdk/ndk/android-ndk-r13b -DANDROID_ABI=armeabi-v7a -DANDROID_TOOLCHAIN=clang -DANDROID_PLATFORM=android-24 -DANDROID_STL=c++_shared
Support for G729 backend implementation from bcg729.
Requirement:
Source code to bcg729, (download here).
Notes:
The source code of bcg729 is licensed under GPLv2.
Below are the steps to use the codec:
For GNU targets:
Build the bcg729 library as specified by the their doc.
Run PJSIP's configure by specifying the location to bcg729 library using --with-bcg729 option. E.g.:
./configure --with-bcg=/home/user/opt
Make sure that the library is usable and correctly configured by looking at the configure output. The check is applicable for iOS and android build as well.
Using bcg729 prefix... /Users/riza/src/bcg729/ios
checking bcg729 usability... ok
For Visual Studio:
Build the bcg729 library using Visual Studio, by generating the project using cmake.
Add bcg729 include and library installation paths (folder that contains libbcg729.dll.a) to Visual Studio search path settings.
Add this to your config_site.h:
#define PJMEDIA_HAS_BCG729 1
For iOS:
Build the bcg729 library as specified by the their doc.
Run PJSIP's configure with --with-bcg729 option. E.g.:
./configure-iphone --with-bcg729=/Users/teluu/bcg729/iphone
Copy libbcg729.a to your XCode project directory. Create a folder ios_local/lib inside your XCode project directory (example: for our ipjsua sample app, the directory will be: (PJPROJECT_DIR)/pjsip-apps/src/pjsua/ios/ios_local/lib). Then copy bcg729 dynamic library files to the folder. E.g:
cp bcg729/lib/libbcg729.a pjproject-iphone/pjsip-apps/src/pjsua/ios/
cp bcg729/lib/*.dylib pjproject-iphone/pjsip-apps/src/pjsua/ios/ios_local/lib
Add libbcg729.a to your application project in XCode.
For Android:
Patch Android.mk in the bcg729 source root directory, just append src/cng.c, src/dtx.c, src/vad.c to LOCAL_SRC_FILES.
Build the bcg729 library, e.g:
cd [bcg729-source-path]
$ANDROID_NDK_ROOT/build/ndk-build APP_ABI=arm64-v8a \
NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk
Create directory lib under bcg729 library source, and copy the libbcg729.a from [bcg729-source-path]/obj/local/[ABI] to it.
Run PJSIP's configure with --with-bcg729 option. E.g.:
./configure-android --with-bcg729=/Users/teluu/bcg729/android