Package selection for Tegra 4i fixed. Initial Tegra5 support added.

pull/1854/head
Alexander Smorkalov 11 years ago
parent 8a4f35704a
commit fd759223fa
  1. 15
      platforms/android/service/engine/jni/BinderComponent/HardwareDetector.h
  2. 5
      platforms/android/service/engine/jni/NativeService/CommonPackageManager.cpp
  3. 2
      platforms/android/service/engine/jni/NativeService/PackageInfo.cpp
  4. 2
      platforms/android/service/engine/jni/NativeService/PackageInfo.h
  5. 18
      platforms/android/service/engine/jni/Tests/OpenCVEngineTest.cpp

@ -14,8 +14,9 @@
#define FEATURES_HAS_VFPv3d16 1L
#define FEATURES_HAS_VFPv3 2L
#define FEATURES_HAS_NEON 4L
#define FEATURES_HAS_NEON2 8L
#define FEATURES_HAS_VFPv4 4L
#define FEATURES_HAS_NEON 8L
#define FEATURES_HAS_NEON2 16L
#define FEATURES_HAS_SSE 1L
#define FEATURES_HAS_SSE2 2L
#define FEATURES_HAS_SSSE3 4L
@ -24,10 +25,12 @@
// TODO: Do not forget to add Platrfom name to PackageInfo::PlatformNameMap
// in method PackageInfo::InitPlatformNameMap()
#define PLATFORM_UNKNOWN 0L
#define PLATFORM_TEGRA 1L
#define PLATFORM_TEGRA2 2L
#define PLATFORM_TEGRA3 3L
#define PLATFORM_TEGRA4 4L
#define PLATFORM_TEGRA 1L
#define PLATFORM_TEGRA2 2L
#define PLATFORM_TEGRA3 3L
#define PLATFORM_TEGRA4 4L
#define PLATFORM_TEGRA4i 5L
#define PLATFORM_TEGRA5 6L
int DetectKnownPlatforms();
int GetProcessorCount();

@ -196,8 +196,11 @@ std::vector<std::pair<int, int> > CommonPackageManager::InitArmRating()
result.push_back(std::pair<int, int>(PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_VFPv3d16 | FEATURES_HAS_NEON));
result.push_back(std::pair<int, int>(PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON));
result.push_back(std::pair<int, int>(PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_VFPv3d16 | FEATURES_HAS_NEON));
result.push_back(std::pair<int, int>(PLATFORM_UNKNOWN, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_VFPv3d16 | FEATURES_HAS_VFPv4 | FEATURES_HAS_NEON));
result.push_back(std::pair<int, int>(PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON));
result.push_back(std::pair<int, int>(PLATFORM_TEGRA4, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_NEON));
result.push_back(std::pair<int, int>(PLATFORM_TEGRA4i, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_VFPv4 | FEATURES_HAS_NEON));
result.push_back(std::pair<int, int>(PLATFORM_TEGRA4, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_VFPv4 | FEATURES_HAS_NEON));
result.push_back(std::pair<int, int>(PLATFORM_TEGRA5, ARCH_ARMv7 | FEATURES_HAS_VFPv3 | FEATURES_HAS_VFPv4 | FEATURES_HAS_NEON));
return result;
}

@ -19,6 +19,8 @@ map<int, string> PackageInfo::InitPlatformNameMap()
result[PLATFORM_TEGRA2] = PLATFORM_TEGRA2_NAME;
result[PLATFORM_TEGRA3] = PLATFORM_TEGRA3_NAME;
result[PLATFORM_TEGRA4] = PLATFORM_TEGRA4_NAME;
result[PLATFORM_TEGRA4i] = PLATFORM_TEGRA4_NAME;
result[PLATFORM_TEGRA5] = PLATFORM_TEGRA5_NAME;
return result;
}

@ -21,10 +21,12 @@
#define FEATURES_HAS_SSSE3_NAME "ssse3"
#define FEATURES_HAS_GPU_NAME "gpu"
// TODO: Do not forget to update PackageInfo::InitPlatformNameMap() after constant changes
#define PLATFORM_TEGRA_NAME "tegra"
#define PLATFORM_TEGRA2_NAME "tegra2"
#define PLATFORM_TEGRA3_NAME "tegra3"
#define PLATFORM_TEGRA4_NAME "tegra4"
#define PLATFORM_TEGRA5_NAME "tegra5"
class PackageInfo
{

@ -20,16 +20,16 @@ class ServiceStarter
public:
ServiceStarter()
{
PackageManager = new PackageManagerStub();
Engine = new OpenCVEngine(PackageManager);
PackageManager = new PackageManagerStub();
Engine = new OpenCVEngine(PackageManager);
defaultServiceManager()->addService(IOpenCVEngine::descriptor, Engine);
LOGI("OpenCVEngine native service started successfully");
ProcessState::self()->startThreadPool();
defaultServiceManager()->addService(IOpenCVEngine::descriptor, Engine);
LOGI("OpenCVEngine native service started successfully");
ProcessState::self()->startThreadPool();
}
~ServiceStarter()
{
delete PackageManager;
delete PackageManager;
}
PackageManagerStub* PackageManager;
@ -46,9 +46,9 @@ sp<IOpenCVEngine> InitConnect()
do
{
EngineService = ServiceManager->getService(IOpenCVEngine::descriptor);
if (EngineService != 0) break;
usleep(500000); // 0.5 s
EngineService = ServiceManager->getService(IOpenCVEngine::descriptor);
if (EngineService != 0) break;
usleep(500000); // 0.5 s
} while(true);
Engine = interface_cast<IOpenCVEngine>(EngineService);

Loading…
Cancel
Save