Building IMSDroid Source

Building Java Code

To build the java code you only need Eclipse and Android SDK.

Building Native libraries

IMSDroid contains only one native library (tinyWRAP.so) written in C++ as a wrapper for doubango project. The JNI files are generated using SWIG.

To build tinyWRAP you have to build all doubango's libraries (ANSI-C).

tinyWRAP depends on:

  • tinySAK (Swiss Army Knife): Utilities functions (SHA-1, MD5, HMAC, String, List, Timers, Thread, Mutex, Semaphore, ...)
  • tinyNET: Networking (DNS, DHCPv4/v6, STUN, TURN, ICE, ENUM, Sockets, ...)
  • tinyHTTP: HTTP stack (CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE, ...)
  • tinyXCAP: XCAP stack (AUID manager, URL generator) without XML parser (See Java code for parsers)
  • tinyIPSec: IPSec SA manager. Useless for Android but you MUST have it
  • tinySMS: SMS over IP (SM-TL, SM-RL) for IMS/LTE networks
  • tinySIGCOMP: Signaling Compression
  • tinySDP: SDP protocol
  • tinyRTP: RTP/RTCP protocols
  • tinyMSRP: MSRP protocol (Chat and File Transfer)
  • tinyMEDIA: Media plugins manager (Audio, video, Codecs, sessions, MSRP, QoS, ...)
  • tinyDAV(Doubango Audio Video): Media plugins implementation
  • tinySIP: SIP/IMS stack

The project also depends on FFmpeg, x264, opencore-amr, libogg, libvorbis, libtheora, iLBC, Speex, ... but you don't need to rebuild these libraries as they are already part of doubango ($(DOUBANGO_HOME)/thirdparties/android/lib).

Checkout doubango

svn checkout http://doubango.googlecode.com/svn/trunk/ doubango-read-only

Adjusting root.mk

  1. goto $(DOUBANGO_HOME)/android-projects and open root.mk with your preferred text editor
  2. Change $ANDROID_NDK_ROOT variable to point to the NDK root directory (e.g. /cygdrive/c/android-ndk)
  3. Change $ANDROID_SDK_ROOT variable to point to the SDK root directory (e.g. /cygdrive/c/android-sdk). This step is not required if you don't wish to use adb utility.
  4. Change $ANDROID_PLATFORM variable to point to your preferred platform root directory (e.g. $(ANDROID_NDK_ROOT)/build/platforms/android-1.5)
  5. Set $ANDROID_GCC_VER variable with your GCC version (e.g. 4.2.1)
  6. Open new Console window
  7. Add the toolchain root binary directory to the system $PATH if not already done:
    export PATH=$ANDROID_NDK_ROOT\build\prebuilt\$(HOST)\arm-eabi-4.2.1\bin:$PATH
where $HOST is equal to darwin-x86 on MAC OS X, windows on Windows XP/Vista/7 and linux-x86 on Unix-like systems. We assume that $(ANDROID_GCC_VER) is equal to 4.2.1.

  1. Set your custom $(CFLAGS) flags to change the default behavior. Example:
    export CFLAGS="–Os –DDEBUG_LEVEL=DEBUG_LEVEL_ERROR"

You can off course set any valid GCC $(CFLAGS) flags.

Example of doubango's specific flags:

  • -DTNET_HAVE_OPENSSL_H=1: Enable support for TLS (You MUST have OpenSSL)
  • -DJB_HISTORY_SIZE=500: Set audio jitter buffer size to 500 frames
  • -DFLIP_DECODED_PICT=1: Flip the decode video frames
  • ...

Building libtinyWRAP.so without G729AB

  1. Go to the android-projects root directory:
    cd $(DOUBANGO_HOME)/android-projects
  2. Build all projects:
    ../bindings/java/android/buildAll.sh
    
    # For neon optimizations
    #../bindings/java/android/buildAll.sh NEON=yes

You can add NEON=yes to enable neon optimization for armv7-a processors. You MUST use at least NDK r4b.

The binaries will be generated under $(DOUBANGO_HOME)/android-projects/output. The shared libraries will be named libtinyWRAP_armv7-a.so if built with neon optimizations. Otherwise it will be named libtinyWRAP_armv5te.so. Rename the library as libtinyWRAP.so and copy it to imsdroid\libs\$(ABI) where ABI is equal to armeabi for the ARMv5te version or armeabi-v7a for ARMv7-a.

Building libtinyWRAP.so with G729AB

Starting IMSDroid revision 311 and doubango revision 498 we fully support G.729 annex A and B (CNG and VAD).



G.729 should only be used for experimental purpose. G.729 includes patents from several companies and is licensed by Sipro Lab Telecom.

Sipro Lab Telecom is the authorized Intellectual Property Licensing Administrator for G.729 technology and patent pool.

In a number of countries, the use of G.729 may require a license fee and/or royalty fee.

Because of the licensing issue the application is not built with G.729.

To build libtinyWRAP.so with G.729AB support:

  1. Go into $(DOUBANGO_HOME) directory

    cd $(DOUBANGO_HOME)
  2. Checkout the ARM optimized version of G729AB into /cygdrive/c/tmp
    svn checkout http://g729.googlecode.com/svn/trunk/ /cygdrive/c/tmp/g729b
  3. Copy G729AB files into doubango project
    cp -f /cygdrive/c/tmp/g729b/* $(DOUBANGO_HOME)/g729b
  4. Build and install G729AB library
    cd $(DOUBANGO_HOME)/android-projects
    make PROJECT=g729b BT=static install
    
    #For cleanup
    #make PROJECT=g729b BT=static clean
  5. Build tinyWRAP with G29AB
    ../bindings/java/android/buildAll.sh G729=yes
    
    # For neon optimizations
    #../bindings/java/android/buildAll.sh G729=yes NEON=yes

You can add NEON=yes to enable neon optimization for armv7-a processors. You MUST use at least NDK r4b.

The binaries will be generated under $(DOUBANGO_HOME)/android-projects/output. The shared libraries will be named libtinyWRAP_armv7-a.so if built with neon optimizations. Otherwise it will be named libtinyWRAP_armv5te.so. Rename the library as libtinyWRAP.so and copy it to imsdroid\libs\$(ABI) where ABI is equal to armeabi for the ARMv5te version or armeabi-v7a for ARMv7-a.

Et voilà

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值