webrtc编译

WebRTC源码下载-20161219

https://blog.csdn.net/qq_22716879/article/details/53760879

https://blog.csdn.net/ai2000ai/article/details/80880362

[WebRTC架构分析]下载编译

https://zhuanlan.zhihu.com/p/80619566?from_voters_page=true

https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/index.md

webrtc在Linux下源码编译的一些整理

http://blog.ikernel.cn/2020/03/13/webrtc%E5%9C%A8Linux%E4%B8%8B%E6%BA%90%E7%A0%81%E7%BC%96%E8%AF%91%E7%9A%84%E4%B8%80%E4%BA%9B%E6%95%B4%E7%90%86/#webrtc-branch

https://github.com/RTC-Developer/WebRTC-Documentation-in-Chinese

https://webrtc.org/getting-started/firebase-rtc-codelab

 

https://webrtc.github.io/webrtc-org/native-code/development/

mkdir webrtc-checkout
cd webrtc-checkout
fetch --nohooks webrtc
gclient sync
git config branch.autosetupmerge always
git config branch.autosetuprebase always
cd src
git checkout master
git new-branch your-branch-name
git checkout master
git pull origin master
gclient sync
git checkout my-branch
git merge master
gn gen out/Default
gn gen out/Default --args='is_debug=false'
gn clean out/Default
ninja -C out/Default

git checkout -b my_branch refs/remotes/branch-heads/3987
gclient sync

which gclient
# cd to depot_tools dir
# edit update_depot_tools; add an exit command at the top of the file
git log  # find a hash close to the date when the branch happened
git checkout <hash>
cd ~/dev/webrtc/src
gclient sync
# When done, go back to depot_tools, git reset --hard, run gclient again and
# verify the current branch becomes REMOTE:origin/master

 

WebRTC Android版本编译

https://www.cnblogs.com/Hi-blog/p/11311141.html

webrtc 常用编译参数列表

https://blog.csdn.net/liwenlong_only/article/details/85063168

 

webrtc编译调试

https://blog.csdn.net/zhuiyuanqingya/article/details/81449982

WebRTC 开发(二)源码下载与编译

http://depthlove.github.io/2019/05/02/webrtc-development-2-source-code-download-and-build/

 

webrtc 编译linux版本的各种问题

https://blog.csdn.net/u011493488/article/details/91443043

 

WebRTC编译系统之gn files

https://blog.csdn.net/foruok/article/details/70157065

在“WebRTC 构建系统介绍之gn和ninja”中,大概介绍了 gn 和 ninja 的简单用法,这次来看看 gn 用到的项目文件 .gn 、 .gni 和 DEPS ,它们指导了如何生成 ninja 构建文件。

借用 C++ 的概念,如果把 gn 看成一个编译系统, .gn 就是源文件, .gni 就是头文件。我们姑且这么理解就好了(其实 gni 里做的事情, gn 都可以做)。DEPS 主要用来设定包含路径。

gn 和 gni 文件都在源码树中,比如 src 目录。当执行 gn gen 时,gn 工具根据 gn 和 gni 生成 ninja 文件并将这些 ninja 文件放到指定的构建目录中。

.gn

.gn 文件是 GN build 的 “源文件”,在这里可以做各种条件判断和配置,gn 会根据这些配置生成特定的 ninja 文件。

.gn 文件中可以使用预定义的参数,比如 is_debug , target_os , rtc_use_h264 等。

.gn 中可以 import .gni 文件。

看一下 src/BUILD.gn :

import("webrtc/webrtc.gni")

group("default") {
  testonly = true
  deps = [
    "//webrtc",
    #"//webrtc/examples",
    #"//webrtc/tools",
  ]
  if (rtc_include_tests) {
    deps += [ "//webrtc:webrtc_tests" ]
  }
}

.gn 和 .gni 文件中用到各种指令,都在这里有说明:GN Reference

这个 gn 文件中,导入了 webrtc/webrtc.gni 文件。

这个 gn 文件,用 group 指令声明了一个 default 目标,这个目标依赖 webrtc 、 webrtc/examples 和 webrtc/tools ,你可以在 webrtc 、 webrtc/examples 、 webrtc/tools 目录下找到对应的 BUILD.gn 。你可以把 group 当做 VS 的 solution ,或者 QtCreator 的 dir 项目。

gn 文件中也可以通过 defines 来定义宏,通过 cflags 来指定传递给编译器的标记,通过 ldflags 指定传递给链接器的标记,还可以使用 sources 指定源文件。下面是 webrtc/BUILD.gn 文件的部分内容:

  if (is_posix) {
    defines += [ "WEBRTC_POSIX" ]
  }
  if (is_ios) {
    defines += [
      "WEBRTC_MAC",
      "WEBRTC_IOS",
    ]
  }
  if (is_linux) {
    defines += [ "WEBRTC_LINUX" ]
  }
  if (is_mac) {
    defines += [ "WEBRTC_MAC" ]
  }
  if (is_win) {
    defines += [
      "WEBRTC_WIN",
      "_CRT_SECURE_NO_WARNINGS",  # Suppress warnings about _vsnprinf
    ]
  }
  if (is_android) {
    defines += [
      "WEBRTC_LINUX",
      "WEBRTC_ANDROID",
    ]
  }
  if (is_chromeos) {
    defines += [ "CHROMEOS" ]
  }

.gni

gni 文件是 GN build 使用的头文件,它里面可以做各种事情,比如定义变量、宏、定义配置、定义模板等。

看下 webrtc/webrtc.gni 文件:

 

webrtc.gni 是一个比较特殊的 gni 文件,你可以把它看做全局配置文件。

webrtc.gni 定义了 WebRTC 项目用到的一些标记,比如 rtc_build_libvpx、rtc_build_ssl、rtc_use_h264 等。

还使用 template 语句定义了几个模板,比如 rtc_executable 、 rtc_static_library 、 rtc_shared_library ,这几个模板定义了生成可执行文件、静态库、动态库的规则。在 webrtc/examples/BUILD.gn 中就有用到这些模板,用它们来指导如何生成可执行文件、静态库等。

你也可以直接使用 gn 内置的 shared_library 和 static_library 来声明目标,比如 third_party/ffmpeg/BUILD.gn 就使用 shared_library 来生成动态库。

DEPS 文件

给个例子看看吧,webrtc/examples/DEPS :

include_rules 定义了包含路径。

修改 .gn 和 .gni

了解 .gn 和 .gni 文件的目的是修改它们。比如你想打开 WebRTC 对 H264 的支持,就可以修改 webrtc/webrtc.gni ,直接把 rtc_use_h264 设置为 true 。

比如你想为某个模块加一些文件,就可以修改 .gn 文件,修改 sources 变量,直接把你的源文件加进去。


好啦,到这儿吧。

相关阅读:

 

 

WebRTC第七步:webrtc编译调试

https://blog.csdn.net/cabbage2008/article/details/52818800

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值