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

Martin Storsjö martin at martin.st
Sun Sep 21 11:35:56 CEST 2014


---
This should allow VLC to actually run on such devices. Untested
in practice.
---
 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..c26a854 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(" fp ")))
                     hasFpu = true;
                 if(line.startsWith("processor"))
                     processors++;
-- 
1.8.5.2 (Apple Git-48)



More information about the Android mailing list