Skip to content

Question: Tips to build this library on top of the WebRTC fork from LiveKit #170

Closed
@tamimattafi

Description

@tamimattafi

Hello @devopvoid!
Thank you for this amazing library!

I'm trying to build WebRTC sources to use on Desktop apps, and specifically using this fork: https://github.com/webrtc-sdk/webrtc

According to the few changes made by the fork, it is possible to use the same JNI files from your library with some tweaks. I tried to adjust CMakeLists.txt to clone and sync sources from their branch instead of chromium, but compilation fails with this error:

...
[ 18%] Building CXX object CMakeFiles/webrtc-java.dir/src/JNI_AudioConverter.cpp.o
In file included from /Users/tamimattafi/Projects/java/webrtc-java/webrtc-jni/src/main/cpp/src/JNI_AudioConverter.cpp:18:
/Users/tamimattafi/Projects/java/webrtc-java/webrtc-jni/src/main/cpp/include/media/audio/AudioConverter.h:25:10: fatal error: 'rtc_base/constructor_magic.h' file not found
   25 | #include "rtc_base/constructor_magic.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/webrtc-java.dir/src/JNI_AudioConverter.cpp.o] Error 1
make[1]: *** [CMakeFiles/webrtc-java.dir/all] Error 2
make: *** [all] Error 2
[WARNING] Command: [/Users/tamimattafi/Projects/java/webrtc-java/webrtc-jni/target/dependency/cmake/bin/cmake, --build, /Users/tamimattafi/Projects/java/webrtc-java/webrtc-jni/target/macos-aarch64, --target, install]
[WARNING] Directory: null
[WARNING] Environment: {HOMEBREW_PREFIX=/opt/homebrew, TERM_SESSION_ID=D8EF333F-E43E-46E7-B706-1D86DF717E2F, SHLVL=1, INFOPATH=/opt/homebrew/share/info:, SHELL=/bin/zsh, __CFBundleIdentifier=com.apple.Terminal, LC_ALL=en_US.UTF-8, TMPDIR=/var/folders/w0/ptg5t1g90jsdpx2045v8wxnh0000gn/T/, MAVEN_PROJECTBASEDIR=/Users/tamimattafi/Projects/java/webrtc-java, ZSH=/Users/tamimattafi/.oh-my-zsh, HOME=/Users/tamimattafi, HOMEBREW_REPOSITORY=/opt/homebrew, PATH=/Users/tamimattafi/depot_tools:/Users/tamimattafi/.rbenv/shims:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.13/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/bin, LOGNAME=tamimattafi, TERM=xterm-256color, RBENV_SHELL=zsh, LS_COLORS=di=1;36:ln=35:so=32:pi=33:ex=31:bd=34;46:cd=34;43:su=30;41:sg=30;46:tw=30;42:ow=30;43, __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0, XPC_FLAGS=0x0, MAVEN_CMD_LINE_ARGS= install, LANG=en_US.UTF-8, TERM_PROGRAM_VERSION=455.1, LC_CTYPE=UTF-8, TERM_PROGRAM=Apple_Terminal, JAVA_HOME=/opt/homebrew/opt/openjdk/libexec/openjdk.jdk/Contents/Home, LESS=-R, LSCOLORS=Gxfxcxdxbxegedabagacad, SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.ObNXtNekKG/Listeners, OLDPWD=/Users/tamimattafi/Projects/java/webrtc-java, XPC_SERVICE_NAME=0, PAGER=less, USER=tamimattafi, HOMEBREW_CELLAR=/opt/homebrew/Cellar, PWD=/Users/tamimattafi/Projects/java/webrtc-java}
[WARNING] Exit code: 2
...

It seems like the fork uses a newer version of WebRTC, and specifically 6422 (m125) instead of the version used by this library, which is 4844 (m99).

I would appreciate any help with these questions:

  1. Are there any plans to update the library to use a newer version of WebRTC?
  2. If not, do you have any tips on how to correctly update the sources to use the m125 version?
  3. My experience with JNI is very limited, do you have any tips or advice to write the JNI layer from scratch, in case the library isn't compatible with the fork? It already has JNI files for android that can be used as a reference
  4. Are you interested in supporting the fork from LiveKit to use the added features? For example End-to-End Encryption

Thank you in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions