[Android] Try to detect "armv7" features properly when running on a 64 bit aarch64 kernel

Martin Storsjö git at videolan.org
Sun Sep 21 12:53:08 CEST 2014


vlc-ports/android | branch: master | Martin Storsjö <martin at martin.st> | Sun Sep 21 10:35:56 2014 +0100| [991e7f20e0441b77f2815ccb80f32e57012711e7] | committer: Edward Wang

Try to detect "armv7" features properly when running on a 64 bit aarch64 kernel

Signed-off-by: Edward Wang <edward.c.wang at compdigitec.com>

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=991e7f20e0441b77f2815ccb80f32e57012711e7
---

 vlc-android/src/org/videolan/libvlc/LibVlcUtil.java |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java b/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
index 8addfbd..a4d5cd3 100644
--- a/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
+++ b/vlc-android/src/org/videolan/libvlc/LibVlcUtil.java
@@ -146,6 +146,10 @@ public class LibVlcUtil {
             BufferedReader br = new BufferedReader(fileReader);
             String line;
             while((line = br.readLine()) != null) {
+                if(!hasArmV7 && line.contains("AArch64")) {
+                    hasArmV7 = true;
+                    hasArmV6 = true; /* Armv8 is backwards compatible to < v7 */
+                }
                 if(!hasArmV7 && line.contains("ARMv7")) {
                     hasArmV7 = true;
                     hasArmV6 = true; /* Armv7 is backwards compatible to < v6 */
@@ -162,9 +166,9 @@ public class LibVlcUtil {
                 // see arch/mips/kernel/proc.c
                 if(line.contains("microsecond timers"))
                     hasMips = true;
-                if(!hasNeon && line.contains("neon"))
+                if(!hasNeon && (line.contains("neon") || line.contains("asimd")))
                     hasNeon = true;
-                if(!hasFpu && line.contains("vfp"))
+                if(!hasFpu && (line.contains("vfp") || (line.contains("Features") && line.contains("fp"))))
                     hasFpu = true;
                 if(line.startsWith("processor"))
                     processors++;



More information about the Android mailing list