Native C++ WebRTC tutorial
This tutorial was first presented at the IIT-RTC 2017 edition.
Upon completion of this tutorial you will have written a complete Native C++ App that can connect to a webrtc SFU (Janus). You will have gone through installation of libwebrtc, and import in a C++ app project through cmake, the steps of a call establishment (a.k.a. JSEP) through SDP offer / answer and corresponding C++ class, as well as the foundations of streams, tracks and frames and how to render them.
The tutorial will consist of both slides and code. You can chose to follow from the slides only for a more theoretical / conceptual knowledge, or you can go ahead and code along. In the latter case, please go ahead and install the software listed in the pre-requisite below.
Prerequisites
The tutorial and corresponding code works theoretically on ubuntu, windows and mac, but the presenters will mainly be knowledgeable on Mac and Windows. The pre-compile screen sharing component will also not be available on linux at this time.
Here are the prerequisite:
- CMake version 3.9 (https://cmake.org/download/)
- Chrome browser (https://www.google.com/chrome/browser/desktop/index.html)
- Qt 5.9 (https://info.qt.io/download-qt-for-application-development, choose Open Source)
- A Webcam if your computer doesn’t have a webcam
- A WebRTC installer
Windows User
- Git for Windows (https://git-scm.com/download/win)
- Microsoft Visual Studio 2015 x64 + Windows 10 SDK version 10.0.14393 (https://my.visualstudio.com/Downloads?PId=2226) You will need a Microsoft account to log into the download page.
- Add this variable to your Path: DEPOT_TOOLS_WIN_TOOLCHAIN and set it to 0
Mac Users
- Git for Mac (https://git-scm.com/download/mac)
- Chrome browser (https://www.google.com/chrome/browser/desktop/index.html)
- A recent XCode (with sdk 10.9 and above) with the development tools (git) installed.
Linux Users
This tutorial won’t have Linux support, if you still want to develop on this platform, you can follow the guide here : https://webrtc.org/native-code/development/
- CMake version 3.9 (https://cmake.org/download/)
- Git for Linux (https://git-scm.com/download/linux)
- Clang compiler (http://releases.llvm.org/download.html)
- Chrome browser (https://www.google.com/chrome/browser/desktop/index.html)
- A text editor
- A Webcam if your computer doesn’t have a webcam
Links to material
- prerequisite (this document)
- Slides
- Github repository