官网 webrtc_android 源码下载和编译



Getting the code

Android development is only supported on Linux.
  1. Install Prerequisite software
  2. Set the path to your Java OpenJDK 7 dir if you're not using the Ubuntu default:
    export  JAVA_HOME=<location of OpenJDK 7>
  3. Set the target OS in your environment:
    export GYP_DEFINES="OS=android"
  4. Create a working directory, enter it, and run:
    fetch --nohooks webrtc_android
    gclient sync
    This will fetch a regular WebRTC checkout with the Android-specific parts added. The same checkout can be used for both Linux and Android development, depending on the OS you set in GYP_DEFINES (see above).
See  Development for instructions on how to update the code, building etc.

Using the bundled Android SDK/NDK

In order to use the Android SDK and NDK that is bundled in third_party/android_tools, run this to get it included in your PATH (from  src/ ):
. build/android/envsetup.sh
Then you'll have adb and all the other Android tools in your PATH.

Running the AppRTCDemo app

AppRTCDemo is an Android application using WebRTC Native APIs via JNI ( JNI wrapper is documented  here).
For instructions on how to build and run, see  webrtc/examples/androidapp/README.

Running WebRTCDemo

WebRTCDemo is a sample app that  can send and receive media streams if manually connected to another WebRTCDemo that is directly accessible (e.g. firewalls might prevent you from establishing a connection). Further it allows setting, enabling and disabling audio and video processing functionality (e.g. echo cancellation, NACK, audio codec and video codec).
For instructions on how to build and run it, see  webrtc/examples/android/media_demo/README

Running WebRTC native tests on an Android device

To build APKs with the WebRTC native tests, follow these instructions.
  1. Ensure you have an Android device set in Developer mode connected via USB.
  2. With the target OS set in GYP_DEFINES as described above, compile everything:
    ninja -C out/Debug 
  3. Check which tests are available (see the output for the --suite flag):
    webrtc/build/android/test_runner.py gtest --help
  4. Run a test on your device:
    webrtc/build/android/test_runner.py gtest -s modules_unittests
  5. If want to run a Release build, add --release to the command line above.If you want to limit to a subset of tests, use the --gtest_filter flag, e.g. 
    webrtc/build/android/test_runner.py gtest -s modules_unittests --gtest_filter=RtpRtcpAPITest.SSRC:RtpRtcpRtcpTest.*
  6. NOTICE: The first time you run a test, you must accept a dialog on the device!
  7. NOTICE: If you run large test suites (like webrtc_perf_tests and modules_unittests) without any test filter, you may need to pass the -t flag to the script to set a higher timeout than the default 60 seconds. 1800 seconds is needed for webrtc_perf_tests on slower devices.

Running WebRTC instrumentation tests on an Android device

To run the instrumentation tests (like  AppRTCDemoTest and  libjingle_peerconnection_android_unittest), use the instrumentation command for test_runner.py instead of gtest.
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值