构建webRTC-Linux版

linux 下构建webRTC


#!/bin/bash
set -exu

__CURRENT__=`pwd`
__DIR__=$(cd "$(dirname "$0")";pwd)
cd ${__DIR__}

start_time=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
start_time_unix_timestamp=$(date +"%s")


bash webrtc/src/build/install-build-deps.sh --no-chromeos-fonts --no-arm

export PATH=${__DIR__}/depot_tools:$PATH

webrtc_build_dir=${__DIR__}/webrtc_build_dir
test -d ${__DIR__}/webrtc_build_dir && rm -rf ${__DIR__}/webrtc_build_dir
mkdir -p ${__DIR__}/webrtc_build_dir

test -d ${__DIR__}/blank/ && rm -rf ${__DIR__}/blank/
mkdir -p ${__DIR__}/blank/

rsync  --delete-before   --progress --stats  -d    $webrtc_build_dir


cd /webrtc/src/

git branch

export PKG_CONFIG_PATH=/usr/lib/pkgconfig/:/usr/share/pkgconfig:/usr/local/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig/

find /usr/lib* -name gmodule-2.0.pc
find /usr/lib* -name gthread-2.0.pc
find /usr/lib* -name gtk+-3.0.pc
find /usr/lib* -name xproto.pc

gn gen $webrtc_build_dir  --args='is_debug=false symbol_level=0  target_cpu="x64" target_os="linux" dcheck_always_on=false is_official_build=true is_component_build=false chrome_pgo_phase=false'

gn args $webrtc_build_dir --list



ninja -C  $webrtc_build_dir

end_time=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
end_time_unix_timestamp=$(date +"%s")
echo $end_time

echo  "花费:"$(( ($end_time_unix_timestamp - $start_time_unix_timestamp)/60 ))"分钟"

下载webRTC源码

用于查看webRTC源码的chromium扩展

参考文档

  1. WebRTC samples
  2. wertc.org
  3. sipjs
  4. webrtc可用性检测
  5. WEBRTC三种类型(Mesh、MCU 和 SFU)的多方通信架构
  6. webrtc 在voip freeswitch中的应用
posted @ 2022-08-16 20:15  jingjingxyk  阅读(520)  评论(0编辑  收藏  举报