Commit befec1fd authored by Simon Morlat's avatar Simon Morlat
Browse files

try to load libraries with the prefered order of the device

parent 6851e5e5
...@@ -20,6 +20,7 @@ package org.linphone.core; ...@@ -20,6 +20,7 @@ package org.linphone.core;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import org.linphone.mediastream.MediastreamerAndroidContext; import org.linphone.mediastream.MediastreamerAndroidContext;
import org.linphone.mediastream.Version; import org.linphone.mediastream.Version;
...@@ -33,30 +34,41 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory { ...@@ -33,30 +34,41 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
System.loadLibrary(s); System.loadLibrary(s);
return true; return true;
} catch (Throwable e) { } catch (Throwable e) {
Log.w("Unable to load optional library lib", s); Log.w("LinphoneCoreFactoryImpl", "Unable to load optional library lib" + s);
} }
return false; return false;
} }
static { static {
String eabi = "armeabi"; List<String> cpuabis=Version.getCpuAbis();
if (Version.isX86()) { String ffmpegAbi;
eabi = "x86"; boolean libLoaded=false;
} else if (Version.isArmv7()) { Throwable firstException=null;
eabi = "armeabi-v7a"; for (String abi : cpuabis){
Log.i("LinphoneCoreFactoryImpl","Trying to load liblinphone for " + abi);
ffmpegAbi=abi;
// FFMPEG (audio/video)
if (abi.startsWith("armeabi")) {
ffmpegAbi="arm";
}
loadOptionalLibrary("ffmpeg-linphone-"+ffmpegAbi);
//Main library
try {
System.loadLibrary("linphone-" + abi);
Log.i("LinphoneCoreFactoryImpl","Loading done with " + abi);
libLoaded=true;
break;
}catch(Throwable e) {
if (firstException == null) firstException=e;
}
} }
// FFMPEG (audio/video) if (!libLoaded){
if (Version.isX86()) { throw new RuntimeException(firstException);
loadOptionalLibrary("ffmpeg-linphone-x86");
} else if (Version.isArmv7()) { }else{
loadOptionalLibrary("ffmpeg-linphone-arm"); Version.dumpCapabilities();
} }
//Main library
System.loadLibrary("linphone-" + eabi);
Version.dumpCapabilities();
} }
@Override @Override
public LinphoneAuthInfo createAuthInfo(String username, String password, public LinphoneAuthInfo createAuthInfo(String username, String password,
......
mediastreamer2 @ 1070145c
Subproject commit ca5e8a01b73f0c8fe0e3eddfd58221cf1c9e33ff Subproject commit 1070145caf60a8e778508a70b1d70600734a7fe3
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment