1、源代码: ?? ?1),master或者main分支 ?? ??? ?git clone https://webrtc.googlesource.com/src/webrtc ?? ?2),进入指定分支页面,然后点击下载包。如下: ?? ??? ?https://webrtc.googlesource.com/src/+/refs/branch-heads/4606
2、编译
??(官网安装文档:https://webrtc.github.io/webrtc-org/native-code/android/): ?? ?1),安装python环境; ?? ??? ?apt-get install python ?? ?2),下载depot_tools ?? ??? ?git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ?? ?3),配置depot_tools ?? ??? ?export DEPOT_TOOLS_PATH=/home/depot_tools ?? ??? ?export PATH=${PATH}:${DEPOT_TOOLS_PATH} ?? ??? ?source ~/.bashrc ?? ?4),执行命令: ?? ??? ?sudo ifconfig enp0s3 mtu 9000 ? ?? ? ?//设置下载最大数据包的大小 ?? ??? ?mkdir webrtc-andorid ?? ??? ?git init ?? ??? ?fetch --nohooks webrtc_android ?? ??? ? ?? ??? ?cd src ?? ??? ?git branch -r //查看远程分支 ?? ??? ?git checkout -b m94 branch-heads/4606 //切换到4606分支 ?? ??? ?gclient sync 或者(gclient sync --with_branch_heads --with_tags -Rv), gclient sync -D ?? ??? ?gclient runhooks ?? ??? ? ?? ??? ?cd src/ ?? ??? ?source build/android/envsetup.sh ? ?? ??? ??? ??? ??? ??? ??? ??? ??? ?//使用捆绑的Android SDK/NDK,可以忽略 ?? ??? ?./build/install-build-deps.sh(只需要在第一次gclient sync以后执行一次) ?? ??? ?./build/install-build-deps-android.sh(只需要在第一次gclient sync以后执行一次) ?? ?5),编译 ?? ??? ?//debug版本 ?? ??? ?1、gn gen out/Debug --args='target_os="android" target_cpu="arm"' ? //构建rtc android所需的文件 ?? ??? ?2、autoninja -C out/Debug ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ?//生成.so文件 ?? ??? ? ?? ??? ?//release 版本 ?? ??? ?1、gn gen out/m94/release/arm64 --args='is_debug=false is_component_build=false is_clang=true rtc_include_tests=true rtc_use_h264=true use_rtti=true target_os="android" use_custom_libcxx=false target_cpu="arm64"' ?? ??? ?2、ninja -C out/m94/release/arm64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ?? ??? ? ?? ??? ?1、gn gen out/m94/release/arm --args='is_debug=false is_component_build=false is_clang=true rtc_include_tests=true rtc_use_h264=true use_rtti=true target_os="android" use_custom_libcxx=false target_cpu="arm"' ?? ??? ?2、ninja -C out/m94/release/arm ?? ??? ? ?? ??? ?//debug版本 ?? ??? ?1、gn gen out/m94/debug/arm64 --args='is_debug=true is_component_build=false is_clang=true rtc_include_tests=true rtc_use_h264=true use_rtti=true target_os="android" use_custom_libcxx=false target_cpu="arm64"' ?? ??? ?2、ninja -C out/m94/debug/arm64 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ?? ? ?? ??? ? ?? ??? ?1、gn gen out/m94/debug/arm --args='is_debug=true is_component_build=false is_clang=true rtc_include_tests=true rtc_use_h264=true use_rtti=true target_os="android" use_custom_libcxx=false target_cpu="arm"' ?? ??? ?2、ninja -C out/m94/debug/arm
?? ??? ? ?? ??? ?或者: ?? ??? ?./tools_webrtc/android/build_aar.py --extra-gn-args 'is_debug=false is_component_build=false is_clang=true rtc_include_tests=false rtc_use_h264=true rtc_enable_protobuf=false use_rtti=true use_custom_libcxx=false' --build-dir ./out/release-build/ ?
|