OpenCV Manager hardware detector workaround for not detected ARM SoC support.

pull/3285/head
Alexander Smorkalov 11 years ago
parent 0b4eb6a964
commit 286c6b496d
  1. 33
      platforms/android/service/engine/jni/BinderComponent/HardwareDetector.cpp

@ -39,19 +39,13 @@ int GetCpuID()
#else
result = ARCH_UNKNOWN;
#endif
#else
#elif defined(__arm__)
LOGD("Using ARM HW detector");
it = cpu_info.find("Processor");
if (cpu_info.end() != it)
{
size_t proc_name_pos = it->second.find(CPU_INFO_ARCH_X86_STR);
if (string::npos != proc_name_pos)
{
}
else
{
proc_name_pos = it->second.find(CPU_INFO_ARCH_ARMV7_STR);
size_t proc_name_pos = it->second.find(CPU_INFO_ARCH_ARMV7_STR);
if (string::npos != proc_name_pos)
{
result |= ARCH_ARMv7;
@ -70,13 +64,32 @@ int GetCpuID()
{
result |= ARCH_ARMv5;
}
else
{
// Treat the arch of current binary. Google Play checks
// device hardware before installation. Let's assume that
// if the binary works, it's compatible with current hardware
#if defined __ARM_ARCH_7A__
result |= ARCH_ARMv7;
result |= FEATURES_HAS_VFPv3d16;
#else
result |= ARCH_ARMv5;
#endif
}
}
}
}
else
{
return ARCH_UNKNOWN;
// Treat the arch of current binary. Google Play checks
// device hardware before installation. Let's assume that
// if the binary works, it's compatible with current hardware
#if defined __ARM_ARCH_7A__
result |= ARCH_ARMv7;
result |= FEATURES_HAS_VFPv3;
#else
result |= ARCH_ARMv5;
#endif
}
it = cpu_info.find("Features");
@ -107,6 +120,8 @@ int GetCpuID()
}
}
}
#else
result = ARCH_UNKNOWN;
#endif
return result;

Loading…
Cancel
Save