Skip to content

Commit

Permalink
android_jni: Allow loading dav1d as a separate shared object
Browse files Browse the repository at this point in the history
Try loading libdav1d.so as a separate shared object. This allows
apps to share dav1d between video and AVIF decoding without having
to bundle it within libavif_android.so to reduce the APK size.
  • Loading branch information
vigneshvg committed Apr 3, 2024
1 parent d2e7fc1 commit cdddec0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
@SuppressWarnings("CatchAndPrintStackTrace")
public class AvifDecoder {
static {
// If dav1d is built as a separate shared object, try loading that first.
try {
System.loadLibrary("dav1d");
} catch (UnsatisfiedLinkError exception) {
// This is not an error. Do nothing.
}
try {
System.loadLibrary("avif_android");
} catch (UnsatisfiedLinkError exception) {
Expand Down

0 comments on commit cdddec0

Please sign in to comment.