mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-18 11:38:08 +00:00
Updated FactoryImpl to change Neon detection in CPUs
This commit is contained in:
parent
d496d95845
commit
ebfa43d5b2
1 changed files with 5 additions and 23 deletions
|
|
@ -20,8 +20,8 @@ package org.linphone.core;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.linphone.CpuUtils;
|
||||
import org.linphone.mediastream.Version;
|
||||
|
||||
import android.util.Log;
|
||||
|
|
@ -43,6 +43,8 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
|||
loadOptionalLibrary("avutil");
|
||||
loadOptionalLibrary("swscale");
|
||||
loadOptionalLibrary("avcore");
|
||||
|
||||
System.loadLibrary("neon");
|
||||
|
||||
if (!hasNeonInCpuFeatures()) {
|
||||
boolean noNeonLibrariesLoaded = loadOptionalLibrary("avcodecnoneon");
|
||||
|
|
@ -151,28 +153,8 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
|||
|
||||
public static boolean hasNeonInCpuFeatures()
|
||||
{
|
||||
ProcessBuilder cmd;
|
||||
boolean result = false;
|
||||
|
||||
try {
|
||||
String[] args = {"/system/bin/cat", "/proc/cpuinfo"};
|
||||
cmd = new ProcessBuilder(args);
|
||||
|
||||
Process process = cmd.start();
|
||||
InputStream in = process.getInputStream();
|
||||
byte[] re = new byte[1024];
|
||||
while(in.read(re) != -1){
|
||||
String line = new String(re);
|
||||
if (line.contains("Features")) {
|
||||
result = line.contains("neon");
|
||||
break;
|
||||
}
|
||||
}
|
||||
in.close();
|
||||
} catch(IOException ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return result;
|
||||
CpuUtils cpu = new CpuUtils();
|
||||
return cpu.isCpuNeon();
|
||||
}
|
||||
|
||||
public static boolean isArmv7()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue