cross compile native libwebrtc ( on x86_64 host) for arm64 No ratings yet.

Direct compile webrtc on arm64 will fail: webrtc seems does not support direct support on arm, we will get errors: … Running hooks: 18% ( 4/22) sysroot_arm64 ________ running ‘vpython src/build/linux/sysroot_scripts/install-sysroot.py –arch=arm64’ in ‘/webrtcbuilds/out’ Installing Debian sid arm64 root image: /webrtcbuilds/out/src/build/linux/debian_sid_arm64-sysroot Downloading https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/953c2471bc7e71a788309f6c2d2003e8b703305d/debian_sid_arm64_sysroot.tar.xz Running hooks: 50% (11/22) binutils ________ running ‘vpython src/third_party/binutils/download.py’ in ‘/webrtcbuilds/out’ Host • Read More »


c++ json lib: nlohmann::json No ratings yet.

nlohmann::json is a popluar json lib. code at: https://github.com/nlohmann/json document at: https://nlohmann.github.io/json/doxygen/index.html   sample code: #include <iostream> 2 #include <nlohmann/json.hpp> 3 4 using json = nlohmann::json; 5 6 int main() 7 { 8  // create a JSON object with different entry types 9  json j = 10  { 11  {“integer”, 1}, 12  {“floating”, 42.23}, 13  {“string”, “hello world”}, 14  • Read More »


Kubernetes Quick Start No ratings yet.

Learning curve for Kubernetes (K8s) could be steep. For most users who are already familiar with basic networking, OS/Linux,  docker container technologies etc, the difficulties , I personally think,  is most likely due to its unique concepts, sometime confusing terms. Based on my learning experience, I wrote a book: Kerbernetes Quick start, hopefully can help • Read More »


webassembly and web audio worklet No ratings yet.

Some notes: web assembly: a cool technology allows you to compile c/c++/rust and other languages into wasm, expose API to javascript world. Web audio worklet/worker: allows developer to intercept audio stream/custom processing A good introduction is at: https://developers.google.com/web/updates/2017/12/audio-worklet Advance pattern: https://developers.google.com/web/updates/2018/06/audio-worklet-design-pattern https://github.com/GoogleChromeLabs/web-audio-samples/tree/master/audio-worklet/design-pattern/shared-buffer/     Combination of wasm and audio worklet can do a fair amount • Read More »


How to use gradle to build java app/project from command line No ratings yet.

Install gradle ( on debian 10) Follow https://linux4one.com/how-to-install-gradle-on-debian-10/ download latest gradle at: https://gradle.org/releases/ for example: wget https://services.gradle.org/distributions/gradle-6.2.1-bin.zip -P /tmp sudo unzip -d /opt/gradle /tmp/gradle-6.2.1.zip sudo nano /etc/profile.d/gradle.sh export GRADLE_HOME=/opt/gradle/gradle-6.2.1 export PATH=${GRADLE_HOME}/bin:${PATH} sudo chmod +x /etc/profile.d/gradle.sh source /etc/profile.d/gradle.sh gradle -v   Try gradle demo Follow https://guides.gradle.org/building-java-applications/ mkdir demo cd demo gradle init # setup gralde project • Read More »


C++ how to replace mutex code with CAS ( compare and exchange ) ( lock-less programming ) 5/5 (2)

It is well known that if  mutex protected codes could potentially be replaced by atomic compare exchange,  thus we cab achieve lock-less programming. In practice, it may need several techniques to get it working. Let’s look at a subscription example: Normal mutex An subscriber  can subscribe some content from a publisher, in other word, a publisher • Read More »


Janus Video Room plugin (how webrtc sfu works) 5/5 (1)

Repo: https://github.com/meetecho/janus-gateway code: video sfu code at: plugins/janus_videoroom.c How sub/pub works: in its plugin implementation: plugins/janus_videoroom.c , there is: struct janus_videoroom_publisher { GSList subscribers; / Subscriptions to this publisher (who’s watching this publisher) */ GSList subscriptions; / Subscriptions this publisher has created (who this publisher is watching) */ } for every incoming  rtp from a publisher: • Read More »


how to cherry-pick a merge commit 5/5 (2)

Problem: For example: I have a merge in main dev branch, I want to cherry-pick that merge into a relatively old prod branch, If we directly do: git cherry-pick merge_commit_in_dev_branch, we will get a  error:  is a merge but no -m option was given. Solution So we need to do this: git cherry-pick -m 1  • Read More »


How to synchronize audio video stream (a/v sync) 4.5/5 (2)

How to a/v sync in IETF RFC? The RFC specified how to do a/v sycn generally in  https://tools.ietf.org/html/rfc6051 RTP flows are synchronised by receivers based on information that is contained in RTCP SR packets generated by senders (specifically, the NTP-format timestamp and the RTP timestamp). Synchronisation requires that a common reference clock MUST be used • Read More »


how to submit a patch to google’s webrtc native 5/5 (1)

I recently submitted a patch to webrtc native. https://webrtc-review.googlesource.com/c/src/+/143841 https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/discuss-webrtc/zn4kmjflvt4 The process is not that difficult, but there could be some caveats depending on your os version etc. Here is my notes/steps:   Read official doc Basically you should follow this official doc is at: https://webrtc.org/contributing/   install depot_tools mkdir webrtc && cd webrtc $ git clone • Read More »