libwebrtc,libmediasoupclient编译总结
程序员文章站
2024-03-25 10:10:04
...
libmediasoupclient使用libwebrtc,所以如果想编译libmediasoupclient,需先编译libwebrtc.
编译libwebrtc
获取webrtc源代码需要使用Chromium depot tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
``
下载完后把depot_tools的路径添加到PATH
export PATH=$PATH:/root/depot_tools
### 下载webrtc源码
```bash
$ mkdir webrtc-checkout
$ cd webrtc-checkout
$ fetch --nohooks webrtc
$ gclient sync
$ cd src
$ git checkout -b m74 refs/remotes/branch-heads/m74
$ gclient sync
编译webrtc
$ gn gen out/Default
$ ninja -C out/Default
如果编译成功,在out/Default/obj目录中可以看到libwebrtc.a文件.
编译libmediasoupclient
$ cmake . -Bbuild \
-DLIBWEBRTC_INCLUDE_PATH:PATH=root/webrtc-checkout/src \
-DLIBWEBRTC_BINARY_PATH:PATH=/root/webrtc-checkout/src/out/Default/obj
$ make -C build/
根据主机的不同,它将生成以下静态库和头文件
libmediasoupclient.a
include/mediasoupclient/mediasoupclient.hpp
上一篇: 新思路