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
-
mkdir webrtc
-
cd webrtc
-
sudo git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools
-
echo “export PATH=/opt/depot_tools:\$PATH” | sudo tee /etc/profile.d/depot_tools.sh
-
sudo git clone https://github.com/raspberrypi/tools.git /opt/rpi_tools
-
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
-
source /etc/profile
Now we need to build sysroot:
-
sudo apt-get install qemu-user-static debootstrap
-
sudo debootstrap –arch armhf –foreign –include=g++,libasound2-dev,libpulse-dev,libudev-dev,libexpat1-dev,libnss3-dev,libgtk2.0-dev wheezy rootfs
-
sudo cp /usr/bin/qemu-arm-static rootfs/usr/bin/
-
sudo chroot rootfs /debootstrap/debootstrap –second-stage
-
find rootfs/usr/lib/arm-linux-gnueabihf -lname ‘/*’ -printf ‘%p %l\n’ | while read link target do sudo ln -snfv “../../..${target}” “${link}” done
-
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:
-
cd src
-
./build/linux/sysroot_scripts/install-sysroot.py –arch=arm
-
gn gen out/Default –args=’target_os=”linux” target_cpu=”arm”‘
-
mv webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc.bak
-
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: