All Projects → aisouard → Libwebrtc

aisouard / Libwebrtc

Licence: apache-2.0
📦 Google's WebRTC implementation in a single static library.

Projects that are alternatives of or similar to Libwebrtc

Tensorflow Cmake
TensorFlow examples in C, C++, Go and Python without bazel but with cmake and FindTensorFlow.cmake
Stars: ✭ 418 (-11.44%)
Mutual labels:  cmake
Geckos.io
🦎 Real-time client/server communication over UDP using WebRTC and Node.js http://geckos.io
Stars: ✭ 439 (-6.99%)
Mutual labels:  webrtc
Sipsorcery
A WebRTC, SIP and VoIP library for C# and .NET Core. Designed for real-time communications apps.
Stars: ✭ 449 (-4.87%)
Mutual labels:  webrtc
Go Stun
A go implementation of the STUN client (RFC 3489 and RFC 5389)
Stars: ✭ 420 (-11.02%)
Mutual labels:  webrtc
React Native Callkeep
iOS CallKit framework and Android ConnectionService for React Native
Stars: ✭ 430 (-8.9%)
Mutual labels:  webrtc
Re
Generic library for real-time communications with async IO support
Stars: ✭ 444 (-5.93%)
Mutual labels:  webrtc
Innoextract
A tool to unpack installers created by Inno Setup
Stars: ✭ 407 (-13.77%)
Mutual labels:  cmake
Modern Cmake Sample
Example library that shows best practices and proper usage of CMake by using targets
Stars: ✭ 463 (-1.91%)
Mutual labels:  cmake
Go Webrtc
WebRTC for Go
Stars: ✭ 432 (-8.47%)
Mutual labels:  webrtc
Stun
Fast RFC 5389 STUN implementation in go
Stars: ✭ 451 (-4.45%)
Mutual labels:  webrtc
Webtorrent Hybrid
WebTorrent (with WebRTC support in Node.js)
Stars: ✭ 422 (-10.59%)
Mutual labels:  webrtc
Cgold
🐋 The Hitchhiker’s Guide to the CMake
Stars: ✭ 428 (-9.32%)
Mutual labels:  cmake
Cmake Raytracer
Ray tracer written in pure CMake
Stars: ✭ 444 (-5.93%)
Mutual labels:  cmake
Uikit Cross Platform
Cross-platform Swift implementation of UIKit, mostly for Android
Stars: ✭ 421 (-10.81%)
Mutual labels:  cmake
Momo
WebRTC Native Client Momo
Stars: ✭ 454 (-3.81%)
Mutual labels:  webrtc
Rules foreign cc
Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja)
Stars: ✭ 418 (-11.44%)
Mutual labels:  cmake
Cpp Reflection
C++ Reflection Parser / Runtime Skeleton
Stars: ✭ 440 (-6.78%)
Mutual labels:  cmake
Recordrtc
RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.
Stars: ✭ 5,008 (+961.02%)
Mutual labels:  webrtc
Coherent Line Drawing
🖼✨Automatically generates line drawing from a photograph
Stars: ✭ 461 (-2.33%)
Mutual labels:  cmake
Tprpix
a Cross-Platform, 2D Survival Sandbox Game Project. Based on C++17/cmake/OpenGL/SQLite3.
Stars: ✭ 448 (-5.08%)
Mutual labels:  cmake

libwebrtc License Join the chat at https://gitter.im/aisouard/libwebrtc Build Status Build Status

This repository contains a collection of CMake scripts to help you embed Google's native WebRTC implementation inside your project as simple as this:

cmake_minimum_required(VERSION 3.3)
project(sample)

find_package(LibWebRTC REQUIRED)
include(${LIBWEBRTC_USE_FILE})

set(SOURCE_FILES main.cpp)
add_executable(sample ${SOURCE_FILES})
target_link_libraries(sample ${LIBWEBRTC_LIBRARIES})

It also produces a pkg-config file if you prefer the classic way:

$ g++ `pkg-config --cflags LibWebRTC` main.cpp -o main `pkg-config --libs LibWebRTC`

Status

The following table displays the current state of this project, including supported platforms and architectures.

x86 x64 arm arm64
Linux
macOS - - -
Windows

Prerequisites

  • CMake 3.3 or later
  • Python 2.7 (optional for Windows since it will use the interpreter located inside the depot_tools installation)

Debian & Ubuntu

  • Required development packages:
# apt-get install build-essential libglib2.0-dev libgtk2.0-dev libxtst-dev \
                  libxss-dev libpci-dev libdbus-1-dev libgconf2-dev \
                  libgnome-keyring-dev libnss3-dev libasound2-dev libpulse-dev \
                  libudev-dev
  • GCC & G++ 4.8 or later, for C++11 support

macOS

  • OS X 10.11 or later
  • Xcode 7.3.1 or later

Windows

  • Windows 7 x64 or later

  • Visual Studio 2015 with updates - Download the Installer

    Make sure that you install the following components:

    • Visual C++, which will select three sub-categories including MFC
    • Universal Windows Apps Development Tools
      • Tools (1.4.1) and Windows 10 SDK (10.0.14393)
  • Windows 10 SDK with Debugging Tools for Windows or Windows Driver Kit 10 installed in the same Windows 10 SDK installation directory.

Compiling

Clone the repository, create an output directory, browse inside it, then run CMake.

$ git clone https://github.com/aisouard/libwebrtc.git
$ cd libwebrtc
$ mkdir out
$ cd out
$ cmake ..

Windows users must add the Win64 suffix to their Visual Studio generator name if they want to build the library for 64-bit platforms, they'll omit it for 32-bit builds and define the TARGET_CPU variable accordingly.

> cmake -G "Visual Studio 14 2015" -DTARGET_CPU=x86
> cmake -G "Visual Studio 14 2015 Win64"

Then they'll have to open the libwebrtc.sln located inside the current output directory and build the ALL_BUILD project.

Unix users will just have to run the following make commands.

$ make
# make install

The library will be located inside the lib folder of the current output directory. The include folder will contain the header files. CMake scripts will be placed inside the lib/cmake/LibWebRTC directory.

Debug and Release configurations

If you are using XCode or Visual Studio, you can simply switch between the Debug and Release configuration from your IDE. The debugging flags will be appended to the generator's parameters.

Otherwise, you must define the CMAKE_BUILD_TYPE variable to Debug.

$ cmake -DCMAKE_BUILD_TYPE=Debug ..

Using WebRTC in your project

At the time of writing this README file, there's no proper way to detect any installation of the WebRTC library and header files. In the meantime, this CMake script generates and declares a LibWebRTC package that will be very easy to use for your projects.

All you have to do is include the package, then embed the "use file" that will automatically find the required libraries, define the proper compiling flags and include directories.

find_package(LibWebRTC REQUIRED)
include(${LIBWEBRTC_USE_FILE})

target_link_libraries(my-app ${LIBWEBRTC_LIBRARIES})

A pkg-config file is also provided, you can obtain the required compiler and linker flags by specifying LibWebRTC as the package name.

$ pkg-config --cflags --libs LibWebRTC

Fetching a specific revision

The latest working release will be fetched by default, unless you decide to retrieve a specific commit by setting it's hash into the WEBRTC_REVISION CMake variable, or another branch head ref into the WEBRTC_BRANCH_HEAD variable.

$ cmake -DWEBRTC_REVISION=be22d51 ..
$ cmake -DWEBRTC_BRANCH_HEAD=refs/branch-heads/57 ..

If both variables are set, it will focus on fetching the commit defined inside WEBRTC_REVISION.

Managing depot_tools

CMake will retrieve the latest revision of the depot_tools repository. It will get the WebRTC repository's commit date, then check-out depot_tools to the commit having the closest date to WebRTC's, in order to ensure a high compatibility with gclient and other tools.

It is possible to prevent this behavior by specifying the location to your own depot_tools repository by defining the DEPOT_TOOLS_PATH variable.

$ cmake -DDEPOT_TOOLS_PATH=/opt/depot_tools ..

Configuration

The library will be compiled and usable on the same host's platform and architecture. Here are some CMake flags which could be useful if you need to perform cross-compiling.

  • BUILD_DEB_PACKAGE

    Generate Debian package, defaults to OFF, available under Linux only.

  • BUILD_RPM_PACKAGE

    Generate Red Hat package, defaults to OFF, available under Linux only.

  • BUILD_TESTS

    Build WebRTC unit tests and mocked classes such as FakeAudioCaptureModule.

  • BUILD_SAMPLE

    Build an executable located inside the sample folder.

  • DEPOT_TOOLS_PATH

    Set this variable to your own depot_tools directory. This will prevent CMake from fetching the one matching with the desired WebRTC revision.

  • GN_EXTRA_ARGS

    Add extra arguments to the gn gen --args parameter.

  • NINJA_ARGS

    Arguments to pass while executing the ninja command.

  • TARGET_OS

    Target operating system, the value will be used inside the --target_os argument of the gn gen command. The value must be one of the following:

    • android
    • chromeos
    • ios
    • linux
    • mac
    • nacl
    • win
  • TARGET_CPU

    Target architecture, the value will be used inside the --target_cpu argument of the gn gen command. The value must be one of the following:

    • x86
    • x64
    • arm
    • arm64
    • mipsel
  • WEBRTC_BRANCH_HEAD

    Set the branch head ref to retrieve, it is set to the latest working one. This variable is ignored if WEBRTC_REVISION is set.

  • WEBRTC_REVISION

    Set a specific commit hash to check-out.

Contributing

Feel free to open an issue if you wish a bug to be fixed, to discuss a new feature or to ask a question. I'm open to pull requests, as long as your modifications are working on the three major OS (Windows, macOS and Linux).

Don't forget to put your name and e-mail address inside the AUTHORS file! You can also reach me on Twitter for further discussion.

Acknowledgements

Many thanks to Dr. Alex Gouaillard for being an excellent mentor for this project.

Everything started from his « Automating libwebrtc build with CMake » blog article, which was a great source of inspiration for me to create the easiest way to link the WebRTC library in any native project.

License

Apache License 2.0 © Axel Isouard

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].