Skip to content

Cross compile WebRTC for Raspberry Pi

Michel Promonet edited this page Mar 16, 2018 · 12 revisions
  • Install Toolchain :

     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
    
     wget -qO- https://releases.linaro.org/components/toolchain/binaries/latest-6/arm-linux-gnueabihf/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz  | sudo tar xJ -C /opt 
     echo "export PATH=/opt/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf/bin:\$PATH" | sudo tee /etc/profile.d/arm_tools.sh
    
     source /etc/profile
    
  • Download WebRTC :

     fetch --no-history webrtc
     src/build/linux/sysroot_scripts/install-sysroot.py --arch=arm
     sed -i -e "s|const auto iter = FindSourceInList(audio_source, &audio_source_list_);|const auto iter = std::find_if(audio_source_list_.begin(), audio_source_list_.end(), [audio_source](const std::unique_ptr<AudioMixerImpl::SourceStatus> \&p) { return p->audio_source == audio_source; });|" src/modules/audio_mixer/audio_mixer_impl.cc
    
  • Build :

     pushd src 
     gn gen arm/out/Release --args='is_debug=false rtc_use_h264=true ffmpeg_branding="Chrome" is_clang=false target_cpu="arm" treat_warnings_as_errors=false rtc_include_tests=false rtc_enable_protobuf=false use_custom_libcxx=false use_ozone=true rtc_include_pulse_audio=false rtc_build_examples=false'
     ninja -C arm/out/Release
     popd
    
Clone this wiki locally