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/ –arch=arm64’ in ‘/webrtcbuilds/out’ Installing Debian sid arm64 root image: /webrtcbuilds/out/src/build/linux/debian_sid_arm64-sysroot Downloading Running hooks: 50% (11/22) binutils ________ running ‘vpython src/third_party/binutils/’ in ‘/webrtcbuilds/out’ Host • Read More »

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

nlohmann::json is a popluar json lib. code at: document at:   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: Advance pattern:     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 download latest gradle at: for example: wget -P /tmp sudo unzip -d /opt/gradle /tmp/ sudo nano /etc/profile.d/ export GRADLE_HOME=/opt/gradle/gradle-6.2.1 export PATH=${GRADLE_HOME}/bin:${PATH} sudo chmod +x /etc/profile.d/ source /etc/profile.d/ gradle -v   Try gradle demo Follow 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: 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 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.!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:   install depot_tools mkdir webrtc && cd webrtc $ git clone • Read More »