Updated tester with new way of checking CPU ABIs
This commit is contained in:
parent
452a8b857e
commit
d8bb551e72
1 changed files with 29 additions and 17 deletions
|
@ -1,5 +1,7 @@
|
||||||
package org.linphone.tester;
|
package org.linphone.tester;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.linphone.core.LinphoneCoreFactory;
|
import org.linphone.core.LinphoneCoreFactory;
|
||||||
import org.linphone.mediastream.Version;
|
import org.linphone.mediastream.Version;
|
||||||
|
|
||||||
|
@ -23,25 +25,35 @@ public class Tester {
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
List<String> cpuabis=Version.getCpuAbis();
|
||||||
LinphoneCoreFactory.instance();
|
String ffmpegAbi;
|
||||||
|
boolean libLoaded=false;
|
||||||
System.loadLibrary("cunit");
|
Throwable firstException=null;
|
||||||
String eabi = "armeabi";
|
for (String abi : cpuabis){
|
||||||
if (Version.isX86()) {
|
Log.i("LinphoneCoreFactoryImpl","Trying to load liblinphone for " + abi);
|
||||||
eabi = "x86";
|
ffmpegAbi=abi;
|
||||||
} else if (Version.isArmv7()) {
|
// FFMPEG (audio/video)
|
||||||
eabi = "armeabi-v7a";
|
if (abi.startsWith("armeabi")) {
|
||||||
}
|
ffmpegAbi="arm";
|
||||||
try {
|
}
|
||||||
System.loadLibrary("linphone_tester-"+eabi);
|
loadOptionalLibrary("ffmpeg-linphone-"+ffmpegAbi);
|
||||||
|
//Main library
|
||||||
} catch (UnsatisfiedLinkError ule) {
|
try {
|
||||||
Log.w("linphone", "Failed to load liblinphone_tester-"+eabi);
|
System.loadLibrary("linphone-" + abi);
|
||||||
System.loadLibrary("linphone_tester");
|
Log.i("LinphoneCoreFactoryImpl","Loading done with " + abi);
|
||||||
|
libLoaded=true;
|
||||||
|
break;
|
||||||
|
}catch(Throwable e) {
|
||||||
|
if (firstException == null) firstException=e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Version.dumpCapabilities();
|
if (!libLoaded){
|
||||||
|
throw new RuntimeException(firstException);
|
||||||
|
|
||||||
|
}else{
|
||||||
|
Version.dumpCapabilities();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public native int run(String args[]);
|
public native int run(String args[]);
|
||||||
|
|
Loading…
Reference in a new issue