node-webrtc mac端环境搭建和编译

1. depot_tools

cd /Users/works/node-webrtc/build-darwin-arm64/external/libwebrtc/download/src

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

export PATH=/Users/works/node-webrtc/build-darwin-arm64/external/libwebrtc/download/depot_tools:$PATH

export DEPOT_TOOLS_UPDATE=0

2. gclient文件创建

solutions = [
  {
    "name": "src",
    "url": "https://webrtc.googlesource.com/src.git@refs/remotes/branch-heads/6478",
    "deps_file": "DEPS",
    "managed": False,
    "custom_deps": {},
  },
]
target_os = ['mac']

  gclient sync

3. gn gen and ninja

###m98
gn gen out/mac-arm64/Release  --args=' target_os="mac" use_custom_libcxx=true  is_component_build=false rtc_build_examples=false rtc_include_tests=false is_debug=false target_cpu="arm64" rtc_libvpx_build_vp9=false rtc_enable_protobuf=false rtc_include_internal_audio_device=true enable_dsyms=true enable_stripping=true rtc_use_h264=true ffmpeg_branding="Chrome" mac_sdk_path="/Users/works/electron/MacOSX14.0.sdk" ' --ide=xcode
ninja -C out/mac-arm64/Release webrtc 
gn gen out/mac-arm64/Debug    --args=' target_os="mac" use_custom_libcxx=true  is_component_build=false rtc_build_examples=false rtc_include_tests=false is_debug=true  target_cpu="arm64" rtc_libvpx_build_vp9=false rtc_enable_protobuf=false rtc_include_internal_audio_device=true enable_dsyms=true enable_stripping=true rtc_use_h264=true ffmpeg_branding="Chrome" mac_sdk_path="/Users/works/electron/MacOSX14.0.sdk" ' --ide=xcode
ninja -C out/mac-arm64/Debug webrtc 

###m126
gn gen out/mac-arm64/Release  --args=' target_os="mac" use_rtti=true use_custom_libcxx=false  is_component_build=false rtc_build_examples=false rtc_include_tests=false is_debug=false target_cpu="arm64" rtc_libvpx_build_vp9=false rtc_enable_protobuf=false rtc_include_internal_audio_device=true enable_dsyms=true enable_stripping=true proprietary_codecs=true rtc_use_h264=true ffmpeg_branding="Chrome" mac_sdk_path="/Users/works/electron/MacOSX14.0.sdk" ' --ide=xcode
ninja -C out/mac-arm64/Release webrtc 
gn gen out/mac-arm64/Debug    --args=' target_os="mac" use_rtti=true use_custom_libcxx=false  is_component_build=false rtc_build_examples=false rtc_include_tests=false is_debug=true  target_cpu="arm64" rtc_libvpx_build_vp9=false rtc_enable_protobuf=false rtc_include_internal_audio_device=true enable_dsyms=true enable_stripping=true proprietary_codecs=true rtc_use_h264=true ffmpeg_branding="Chrome" mac_sdk_path="/Users/works/electron/MacOSX14.0.sdk" ' --ide=xcode
ninja -C out/mac-arm64/Debug webrtc 

4.修改CMakeLists.txt

ExternalProject_Add(
  project_libwebrtc

  PREFIX            ${CMAKE_BINARY_DIR}/external/libwebrtc/prefix
  TMP_DIR           ${CMAKE_BINARY_DIR}/external/libwebrtc/tmp
  STAMP_DIR         ${CMAKE_BINARY_DIR}/external/libwebrtc/stamp
  DOWNLOAD_DIR      ${CMAKE_BINARY_DIR}/external/libwebrtc/download
  SOURCE_DIR        ${CMAKE_BINARY_DIR}/external/libwebrtc/download/src
  BINARY_DIR        ${CMAKE_BINARY_DIR}/external/libwebrtc/build/${CMAKE_BUILD_TYPE}

  BUILD_BYPRODUCTS  ${byproducts}

  #DOWNLOAD_COMMAND  ${CMAKE_COMMAND} -E env DEPOT_TOOLS=${depot_tools_install_dir} PLATFORM=${PLATFORM} WEBRTC_REVISION=${WEBRTC_REVISION} ${CMAKE_SOURCE_DIR}/scripts/download-webrtc.${suffix}
  CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env BINARY_DIR=<BINARY_DIR> DEPOT_TOOLS=${depot_tools_install_dir} GN_GEN_ARGS=${GN_GEN_ARGS} SOURCE_DIR=<SOURCE_DIR> ${CMAKE_SOURCE_DIR}/scripts/configure-webrtc.${suffix}
  BUILD_COMMAND     ${CMAKE_COMMAND} -E env CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} DEPOT_TOOLS=${depot_tools_install_dir} ${CMAKE_SOURCE_DIR}/scripts/build-webrtc.${suffix}
  INSTALL_COMMAND   ""
)
跳过 scripts/build-webrtc.sh
#ninja $TARGETS
跳过 scripts/configure-webrtc.sh
#gn gen ${BINARY_DIR} "--args=${GN_GEN_ARGS} "
#按照步骤3编译

5.cmake-js   

npm install cmake-js -g 

6. arm64 x64 build-vars.js

#export DEBUG=1
cd /Users/works/node-webrtc
npm run build

可将 TTL/UART 串口设备连接至以太网 支持网口升级程序 支持TCP服务器、TCP客户端、UDP模式 支持虚拟串口、Web登录或使用VirCom进行配置 ZLSN2003 概述 ZLSN2003是上海卓岚开发的新一代串口以太网嵌入式模块。该模块功能强大,其基本功能是实现串口联网的方便性,即只要和用户的串口TTL电平的串口连接,ZLSN2003就可以将数据发送到基于TCP/IP/UDP的网络服务器上。默认情况下串口和以太网之间是透明传输协议,即串口发送什么,网络就收到什么数据,不会数据格式化。ZLSN2003内部已经集成网络变压器,外围电路非常简单。 ZLSN2003模块为单片机联网、传统串口设备联网提供了快捷、稳定、经济的方案。不仅能够保证您的产品快速上市,并且为您的产品的稳定提供支撑。 特点 支持在线网络升级固件程序,用户可以从卓岚公司获得软件升级工具和升级firmware,可自行升级到最高版本。 使用配置的ZLVircom工具可以搜索、管理局域网内(支持跨网段搜索)、Internet上的ZLSN2003模块。可一键式配置模块的所有参数。设备配置、管理非常方便。 支持DHCP功能,可以动态获得局域网内的DHCP服务器分配的IP。 支持DNS,自动解析目的域名为IP,目的IP可以为动态域名。 作为TCP Server(TCP服务器端)时,支持独有的100个连接的强大连接能力。 作为TCP Client(TCP客户端)的,支持连接8个目标服务器。作为TCP客户端时,可以在断线后自动进行重连。支持隐含心跳技术,保证网线断线后的恢复。 支持UDP、UDP组播等功能。 支持虚拟串口。 规格 网络界面 以太网 10/100 Mbps 保护 内建1KV电磁隔离 串口界面 界面 TTL电平串口 串口数 1 校验位 None, Even, Odd, Space, Mark 数据位 5~9 停止位 1,2 流控 RTS/CTS,DTR/DCR,XON/XOFF 速率 1200bps~460800bps 软件特性 协议 TCP,HTTP,UDP,ICMP,ARP,IP,DNS,DHCP 虚拟串口平台 Windows 95/98/ME/NT/2000/XP/WIN7/WIN8 配置方式 Web浏览器、卓岚ZLVirCom、串口类AT命令 电器特性 电压输入 DC5V(ZLSN2003-3.3V支持3.3V),210~250mA 机械特性 尺寸 长×宽=43 × 26mm 工作环境 工作温度,湿度 0~70℃,5~95% RH 储存温度,湿度 -45~165℃,5~95% RH W
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值