官网 webrtc_android 源码下载和编译
Getting the codeAndroid development is only supported on Linux.InstallPrerequisite softwareSet the path to your Java OpenJDK 7 dir if you're not using the Ubuntu default:export J
·
Getting the code
Android development is only supported on Linux.
- Install Prerequisite software
- Set the path to your Java OpenJDK 7 dir if you're not using the Ubuntu default:
export
JAVA_HOME=<location of OpenJDK 7>
- Set the target OS in your environment:
export GYP_DEFINES="OS=android"
- Create a working directory, enter it, and run:
fetch --nohooks webrtc_android
gclient syncGYP_DEFINES
(see above).
Using the bundled Android SDK/NDK
In order to use the Android SDK and NDK that is bundled in
Then you'll have
third_party/android_tools
, run this to get it included in your PATH (from
src/
):
. build/android/envsetup.sh
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.
- Ensure you have an Android device set in Developer mode connected via USB.
- With the target OS set in GYP_DEFINES as described above, compile everything:
ninja -C out/Debug
- Check which tests are available (see the output for the --suite flag):
webrtc/build/android/test_runner.py gtest --help
- Run a test on your device:
webrtc/build/android/test_runner.py gtest -s modules_unittests
- 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.*
- NOTICE: The first time you run a test, you must accept a dialog on the device!
- NOTICE: If you run large test suites (like
webrtc_perf_tests
andmodules_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 forwebrtc_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
.
更多推荐
已为社区贡献1条内容
所有评论(0)