Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/fix_unity_android_build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
livekit-ffi: patch
webrtc-sys: patch
---

fix unity android build with "livekit" prefixed jni - #983 (@xianshijing-lk)
8 changes: 4 additions & 4 deletions webrtc-sys/src/android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ std::unique_ptr<webrtc::VideoEncoderFactory>
CreateAndroidVideoEncoderFactory() {
JNIEnv* env = webrtc::AttachCurrentThreadIfNeeded();
webrtc::ScopedJavaLocalRef<jclass> factory_class =
webrtc::GetClass(env, "org/webrtc/DefaultVideoEncoderFactory");
webrtc::GetClass(env, "livekit/org/webrtc/DefaultVideoEncoderFactory");

jmethodID ctor = env->GetMethodID(factory_class.obj(), "<init>",
"(Lorg/webrtc/EglBase$Context;ZZ)V");
"(Llivekit/org/webrtc/EglBase$Context;ZZ)V");

jobject encoder_factory =
env->NewObject(factory_class.obj(), ctor, nullptr, true, false);
Expand All @@ -53,10 +53,10 @@ CreateAndroidVideoDecoderFactory() {
JNIEnv* env = webrtc::AttachCurrentThreadIfNeeded();

webrtc::ScopedJavaLocalRef<jclass> factory_class =
webrtc::GetClass(env, "org/webrtc/WrappedVideoDecoderFactory");
webrtc::GetClass(env, "livekit/org/webrtc/WrappedVideoDecoderFactory");

jmethodID ctor = env->GetMethodID(factory_class.obj(), "<init>",
"(Lorg/webrtc/EglBase$Context;)V");
"(Llivekit/org/webrtc/EglBase$Context;)V");

jobject decoder_factory = env->NewObject(factory_class.obj(), ctor, nullptr);
return webrtc::JavaToNativeVideoDecoderFactory(env, decoder_factory);
Expand Down
Loading