Try Live Demo

This post is a guide for cross compile and build Webrtc Raspberry PI and arm devices.

Initial Steps starts with installing depot tools which are needed for getting webrtc source code. Then continue with installing rpi tools.

WebRTC Raspberry PI Install Steps

  1.  mkdir webrtc

  2.  cd webrtc

  3.  sudo git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools

  4.  echo “export PATH=/opt/depot_tools:\$PATH” | sudo tee /etc/profile.d/depot_tools.sh

  5.  sudo git clone https://github.com/raspberrypi/tools.git /opt/rpi_tools

  6.  echo “export PATH=/opt/rpi_tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin:\$PATH” | sudo tee /etc/profile.d/rpi_tools.sh

  7.  source /etc/profile

Now we need to build sysroot:

  1.  sudo apt-get install qemu-user-static debootstrap

  2.  sudo debootstrap –arch armhf –foreign –include=g++,libasound2-dev,libpulse-dev,libudev-dev,libexpat1-dev,libnss3-dev,libgtk2.0-dev wheezy rootfs

  3. sudo cp /usr/bin/qemu-arm-static rootfs/usr/bin/

  4.  sudo chroot rootfs /debootstrap/debootstrap –second-stage

  5. find rootfs/usr/lib/arm-linux-gnueabihf -lname ‘/*’ -printf ‘%p %l\n’ | while read link target do sudo ln -snfv “../../..${target}” “${link}” done

  6. find rootfs/usr/lib/arm-linux-gnueabihf/pkgconfig -printf “%f\n” | while read target do sudo ln -snfv “../../lib/arm-linux-gnueabihf/pkgconfig/${target}” rootfs/usr/share/pkgconfig/${target} done

Now we will fetch source code:

fetch –no-history –nohooks webrtc

Fetching is a long process so you may go and watch some movies 🙂

If fetch fails run:

gclient sync

After fetching the source code completely, its time for building. Follow the steps below:

  1.  cd src

  2.  ./build/linux/sysroot_scripts/install-sysroot.py –arch=arm

  3.  gn gen out/Default –args=’target_os=”linux” target_cpu=”arm”‘

  4.  mv webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc.bak

  5.  touch webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc

And finally

ninja -C out/Default

With this command, webrtc and examples will be built.

References:

Categories: Tutorial