项目作者: introlab

项目描述 :
Native build of Google's webrtc library.
高级语言: CMake
项目地址: git://github.com/introlab/webrtc-native-build.git
创建时间: 2021-03-15T14:16:57Z
项目社区:https://github.com/introlab/webrtc-native-build

开源协议:Apache License 2.0

下载


webrtc-native-build

Native build of Google’s webrtc library. The library is also packaged with BoringSSL and libyuv.

  • WebRTC is a standard for real-time audio/video/data communication and is mostly used in web browsers.
  • BoringSSL is a fork of OpenSSL that is designed to meet Google’s needs.
  • libyuv is an open source project that includes YUV scaling and conversion functionalities.

License

By default, libwebrtc is built with non-free codecs. To build without them, change the following flags in generate_ninja_files.bash and generate_ninja_files.bat.

  1. rtc_use_h264=false
  2. proprietary_codecs=false
  3. ffmpeg_branding="Chromium"

Dependencies (Linux)

  1. sudo apt-get install ninja-build cmake build-essential libssl-dev libboost-all-dev
  2. sudo apt-get install libglib2.0-dev libgtk-3-dev libpulse-dev libasound2-dev
  3. # For cross compiling
  4. sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu
  5. sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf

Dependencies (Mac)

  1. # XCode and homebrew must be installed first.
  2. brew install ninja

Building

  1. # Create build directory
  2. mkdir build
  3. # Go to build directory
  4. cd build
  5. # Run CMake with arguments
  6. cmake ../ [-DCMAKE_BUILD_TYPE=Release|Debug] [-DCMAKE_BUILD_ARCHITECTURE=arm32|arm64|amd64|win64|osx64]
  7. # Parallel build
  8. make -j
  9. # will copy to dist directory
  10. make install

Building on Windows

Building on Windows is not supported yet for recent versions of WebRTC.
You can submit a PR to help with this if you wish.
If you want to build on Windows, you can use the tag 4389.e7d9f7.130.
There is also a prebuilt version of the library available in the releases section on GitHub.

Dependencies

  • Ninja
    • Copy ninja.exe in 3rdParty/webrtc_native/
  • CMake
  • Git
  • Python
  • MSVC 2022 Build Tools
  • Windows SDK 10.0.20348.0 (make sure that it is checked while installing MSVC)
  • Windows SDK Debugging Tools
    1. Navigate to Control Panel -> Programs -> Programs and Features
    2. Right-click on Windows Software Development Kit, and choose Change
    3. Select Change and click Next
    4. Check the box for Debugging Tools for Windows and click Change
      Make sure to check Add to PATH for everything you install

Setup

  • Create a copy of your <python_dir>/python.exe executable as <python_dir>/python3.exe.
  • Make sure that python, python3, cmake and git are in your path.
  • Make sure the registry entry HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem::LongPathsEnabled is set to 0x1
  • Launch a CMD prompt as Administrator, and execute git config --system core.longpaths true

Building

Using a CMD prompt (not tested with powershell or git-bash or any other shell)

  1. # Create build directory
  2. mkdir build
  3. # Go to build directory
  4. cd build
  5. # Run CMake with arguments
  6. cmake .. -G "Ninja" [-DCMAKE_BUILD_TYPE=Release|Debug]
  7. # Parallel build
  8. ninja
  9. # Copy to dist directory
  10. ninja install
  11. # Generate a zip archive in build/
  12. ninja package

Important notes

  • You might have trouble building if your system is not in English
  • You might have trouble building if the full path to python.exe has at least one space in it

Consuming the library

On Windows, you will have to link any target that consumes this library to these additional Windows libraries:

  • secur32
  • winmm
  • dmoguids
  • wmcodecdspuuid
  • msdmo
  • strmiids
  • iphlpapi

If you don’t link against these libraries, your linker might see missing symbols like these ones:

  • __imp_timeGetTime
  • __imp_timeKillEvent
  • __imp_timeSetEvent
  • __imp_timeBeginPeriod
  • __imp_timeEndPeriod
  • CLSID_CWMAudioAEC
  • IID_IMediaObject
  • IID_IMediaBuffer
  • MoInitMediaType
  • MoFreeMediaType
  • InitializeSecurityContextA
  • AcquireCredentialsHandleA
  • __imp_FreeCredentialsHandle
  • CompleteAuthToken
  • __imp_DeleteSecurityContext

How to use a new version?

  1. Fetch WebRTC Code
    1. mkdir build
    2. cd build
    3. cmake .. -DCMAKE_BUILD_TYPE=Release
  2. Find the new branch-head-number
    1. Open Chrome
    2. Open the following URL chrome://settings/help
    3. The new branch-head-number is the third number of the version (Version 120.0.6099.109 —> branch-head-number = 6099)
  3. Find the commit hash
    1. git checkout branch-heads/<branch-head-number>
    2. git rev-parse HEAD
  4. Update the version (see the next section)
    1. Update the hash and version in the CMakeList.txt file
    2. Update the VERSION file

Versioning Scheme

branch-head-number.first-6-digits-of-webrtc-commit-hash.patch-number

To find the patch-number for a given branch-head-number, use the following web page:
https://chromium.googlesource.com/chromium/src/+/branch-heads/<branch-head-number>/chrome/VERSION

Dropped support

MacOS 10.15 Catalina

GitHub Actions dropped support for MacOS 10.15 Catalina.
However, the latest tag might still work to build under MacOS 10.15.
There are also prebuilt versions of the library available in the releases section on GitHub, for tag version 5039.5df5b1.1 and earlier.

Authors

License

Sponsor

IntRoLab

IntRoLab - Intelligent / Interactive / Integrated / Interdisciplinary Robot Lab