Building IMSDroid Source

本文详细介绍了如何使用Eclipse和Android SDK构建Doubango库,包括构建核心库tinyWRAP及其依赖组件,以及如何启用G.729语音编解码器支持。特别强调了调整配置步骤,如设置NDK和SDK路径,以及特定的GCC编译选项来优化代码性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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à

Leap Motion是一种领先的手势控制技术和硬件设备。在使用Leap Motion时,如果遇到了一些困难,例如安装和运行Leap Motion的插件时出现问题,可以尝试手动从源代码构建插件来解决这些问题。 手动从源代码构建插件意味着我们要下载Leap Motion插件的源代码,并通过一系列步骤来自己编译和构建它们。下面是一些步骤: 1. 首先,我们需要到Leap Motion的官方网站上下载插件的源代码。在下载完成后,解压缩源代码文件。 2. 接下来,我们需要确保在计算机上安装了所需的编译工具和依赖项。这可能包括C++编译器和开发环境等。请确保按照Leap Motion提供的文档或说明来正确安装这些工具。 3. 一旦准备就绪,我们需要打开命令行界面,并导航到源代码的目录。这可以通过使用命令"cd"(change directory)来实现。 4. 一旦我们位于源代码目录中,我们需要运行适当的命令来构建插件。这些命令可能会因不同的操作系统而有所不同。请查阅Leap Motion提供的文档或说明来了解正确的构建命令。 5. 等待一段时间,编译和构建过程将完成。如果一切顺利,我们将获得构建好的插件文件。 6. 最后,我们可以将构建好的插件文件复制到我们希望使用Leap Motion的应用程序中,并按照应用程序的要求进行配置和设置。 总之,手动从源代码构建Leap Motion插件是一个解决问题的方法。尽管这可能需要一些技术知识和操作步骤,但它可以帮助我们解决一些在插件安装和运行过程中遇到的问题。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值