0

I've built ffmpeg for different cpus for using on android and i would like to know to detect them on runtime (in java) in order to select which binary i'm going to use

On android documentation i found:

#include <cpu-features.h>
...
...
if (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM &&
    (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0)
{
    // use NEON-optimized routines
    ...
}
else
{
    // use non-NEON fallback routines instead
    ...
}

this what i need, but i would like to do that on java side... i didnt want to add one more jni layer just to get this information

does anyone know how to get it through java api?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
  • Possible duplicate of [API call to get processor architecture](https://stackoverflow.com/questions/11989629/api-call-to-get-processor-architecture) – Minato Jun 10 '18 at 00:27
  • android api recomends use `Build.SUPPORTED_ABI` instead `System.property()` but none of them gives you the neon capability – Rafael Lima Jun 10 '18 at 00:50
  • So didn't see: [Detecting FPU presence on Android](https://stackoverflow.com/a/8246987/295004) and/or [How to get specific information of an Android device from “/proc/cpuinfo” file?](https://stackoverflow.com/a/26242139/295004) – Morrison Chang Jun 10 '18 at 01:00

0 Answers0