mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 15:48:09 +00:00
try to load libraries with the prefered order of the device
This commit is contained in:
parent
6851e5e5e9
commit
befec1fd93
2 changed files with 30 additions and 18 deletions
|
|
@ -20,6 +20,7 @@ package org.linphone.core;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import org.linphone.mediastream.MediastreamerAndroidContext;
|
||||
import org.linphone.mediastream.Version;
|
||||
|
|
@ -33,30 +34,41 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
|||
System.loadLibrary(s);
|
||||
return true;
|
||||
} catch (Throwable e) {
|
||||
Log.w("Unable to load optional library lib", s);
|
||||
Log.w("LinphoneCoreFactoryImpl", "Unable to load optional library lib" + s);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static {
|
||||
String eabi = "armeabi";
|
||||
if (Version.isX86()) {
|
||||
eabi = "x86";
|
||||
} else if (Version.isArmv7()) {
|
||||
eabi = "armeabi-v7a";
|
||||
List<String> cpuabis=Version.getCpuAbis();
|
||||
String ffmpegAbi;
|
||||
boolean libLoaded=false;
|
||||
Throwable firstException=null;
|
||||
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 (Version.isX86()) {
|
||||
loadOptionalLibrary("ffmpeg-linphone-x86");
|
||||
} else if (Version.isArmv7()) {
|
||||
loadOptionalLibrary("ffmpeg-linphone-arm");
|
||||
|
||||
if (!libLoaded){
|
||||
throw new RuntimeException(firstException);
|
||||
|
||||
}else{
|
||||
Version.dumpCapabilities();
|
||||
}
|
||||
|
||||
//Main library
|
||||
System.loadLibrary("linphone-" + eabi);
|
||||
|
||||
Version.dumpCapabilities();
|
||||
}
|
||||
@Override
|
||||
public LinphoneAuthInfo createAuthInfo(String username, String password,
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit ca5e8a01b73f0c8fe0e3eddfd58221cf1c9e33ff
|
||||
Subproject commit 1070145caf60a8e778508a70b1d70600734a7fe3
|
||||
Loading…
Add table
Reference in a new issue