webrtc-sdk / android

WebRTC pre-compiled library for android.
MIT License
143 stars 22 forks source link

org.webrtc.LibaomAv1Encoder.nativeIsSupported() #1

Closed sunishkumar closed 2 years ago

sunishkumar commented 2 years ago

Im getting the following error.

Fatal Exception: java.lang.UnsatisfiedLinkError: No implementation found for boolean org.webrtc.LibaomAv1Encoder.nativeIsSupported() (tried Java_org_webrtc_LibaomAv1Encoder_nativeIsSupported and Java_org_webrtc_LibaomAv1Encoder_nativeIsSupported__) at org.webrtc.LibaomAv1Encoder.nativeIsSupported(LibaomAv1Encoder.java)

cloudwebrtc commented 2 years ago

It seems that HW does not support AV1 encoder?

davidzhao commented 2 years ago

most devices don't support hardware av1. I think @davidliu's fallback handling should have resolved this.

davidliu commented 2 years ago

I think there's an issue with the JNI linking code here, seems to be broken somewhere. If the software video encoder fallback handling is relied on to create these codecs, it'll crash due to the linking issue.

davidliu commented 2 years ago

Oh, this is actually an old android bug with loading native libraries with an app that has a minimum sdk less than 21.

The solution is to use the https://github.com/KeepSafe/ReLinker library to load native libraries. This will fix any issues with UnsatisfiedLinkErrors.


Closing since it's an issue with Android rather than the webrtc library.

davidliu commented 2 years ago

One other possibility that came to mind is that you're trying to access the native library before it's loaded into memory. PeerConnectionFactory.initialize() loads the native library, but if you try to use any native methods prior to loading, it will crash.