Arm-v7a neon package support enabled.
$(TOP)/system/core/include
LOCAL_CFLAGS += -DPLATFORM_ANDROID
+LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_V7A_FEATURES
#LOCAL_CFLAGS += -D__SUPPORT_TEGRA3
-#LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_V7A_FEATURES
#LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_FEATURES
LOCAL_PRELINK_MODULE := false
LOCAL_PRELINK_MODULE := false
LOCAL_CFLAGS += -DPLATFORM_ANDROID
+LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_V7A_FEATURES
#LOCAL_CFLAGS += -D__SUPPORT_TEGRA3
-#LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_V7A_FEATURES
#LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_FEATURES
LOCAL_MODULE := libOpenCVEngine_jni
{
if (ARCH_X86 & CpuID)
{
- LOGD("Found processor with x86 arch");
+ LOGD("PackageInfo::PackageInfo: package arch x86");
FullName += string("_") + ARCH_X86_NAME;
#ifdef __SUPPORT_INTEL_FEATURES
string features = JoinIntelFeatures(CpuID);
-#else
- string features;
-#endif
if (!features.empty())
{
FullName += string("_") + features;
}
+#endif
}
else if (ARCH_X64 & CpuID)
{
- LOGD("Found processor with x64 arch");
+ LOGD("PackageInfo::PackageInfo: package arch x64");
#ifdef __SUPPORT_INTEL_x64
FullName += string("_") + ARCH_X64_NAME;
#else
#endif
#ifdef __SUPPORT_INTEL_FEATURES
string features = JoinIntelFeatures(CpuID);
-#else
- string features;
-#endif
if (!features.empty())
{
FullName += string("_") + features;
}
+#endif
}
else if (ARCH_ARMv5 & CpuID)
{
- LOGD("Found processor with ARMv5 arch");
+ LOGD("PackageInfo::PackageInfo: package arch ARMv5");
FullName += string("_") + ARCH_ARMv5_NAME;
#ifdef __SUPPORT_ARMEABI_FEATURES
string features = JoinARMFeatures(CpuID);
-#else
- string features;
-#endif
if (!features.empty())
{
FullName += string("_") + features;
}
+#endif
}
else if (ARCH_ARMv6 & CpuID)
{
- LOGD("Found processor with ARMv6 arch");
+ LOGD("PackageInfo::PackageInfo: package arch ARMv6");
// NOTE: ARM v5 used instead ARM v6
//FullName += string("_") + ARCH_ARMv6_NAME;
FullName += string("_") + ARCH_ARMv5_NAME;
#ifdef __SUPPORT_ARMEABI_FEATURES
string features = JoinARMFeatures(CpuID);
-#else
- string features;
-#endif
if (!features.empty())
{
FullName += string("_") + features;
}
+#endif
}
else if (ARCH_ARMv7 & CpuID)
{
- LOGD("Found processor with ARMv7 arch");
+ LOGD("PackageInfo::PackageInfo: package arch ARMv7");
FullName += string("_") + ARCH_ARMv7_NAME;
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
string features = JoinARMFeatures(CpuID);
-#else
- string features;
-#endif
if (!features.empty())
{
FullName += string("_") + features;
}
+#endif
}
else if (ARCH_ARMv8 & CpuID)
{
- LOGD("Found processor with ARMv8 arch");
+ LOGD("PackageInfo::PackageInfo: package arch ARMv8");
#ifdef __SUPPORT_ARMEABI_V8
FullName += string("_") + ARCH_ARMv8_NAME;
#else
}
else
{
- LOGD("Found processor with unknown arch");
+ LOGD("PackageInfo::PackageInfo: package arch unknown");
Version.clear();
CpuID = ARCH_UNKNOWN;
Platform = PLATFORM_UNKNOWN;
}
else
{
- LOGD("Found processor with unknown arch");
+ LOGD("PackageInfo::PackageInfo: package arch unknown");
Version.clear();
CpuID = ARCH_UNKNOWN;
Platform = PLATFORM_UNKNOWN;
EXPECT_EQ(0, result.size());
}
+TEST(OpenCVEngineTest, GetPathForCompatiblePackage1)
+{
+ sp<IOpenCVEngine> Engine = InitConnect();
+ Starter.PackageManager->InstalledPackages.clear();
+ Starter.PackageManager->InstallVersion("242", PLATFORM_UNKNOWN, ARCH_ARMv5);
+ EXPECT_FALSE(NULL == Engine.get());
+ String16 result = Engine->GetLibPathByVersion(String16("2.4"));
+ EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv5/lib", String8(result).string());
+}
+
+TEST(OpenCVEngineTest, GetPathForCompatiblePackage2)
+{
+ sp<IOpenCVEngine> Engine = InitConnect();
+ Starter.PackageManager->InstalledPackages.clear();
+ Starter.PackageManager->InstallVersion("242", PLATFORM_TEGRA3, ARCH_ARMv7 | FEATURES_HAS_NEON);
+ EXPECT_FALSE(NULL == Engine.get());
+ String16 result = Engine->GetLibPathByVersion(String16("2.4"));
+#ifdef __SUPPORT_TEGRA3
+ EXPECT_STREQ("/data/data/org.opencv.lib_v24_tegra3/lib", String8(result).string());
+#else
+#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
+ EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a_neon/lib", String8(result).string());
+#else
+ EXPECT_STREQ("/data/data/org.opencv.lib_v24_armv7a/lib", String8(result).string());
+#endif
+#endif
+}
+
+TEST(OpenCVEngineTest, GetPathForInCompatiblePackage1)
+{
+ sp<IOpenCVEngine> Engine = InitConnect();
+ Starter.PackageManager->InstalledPackages.clear();
+ Starter.PackageManager->InstallVersion("242", PLATFORM_UNKNOWN, ARCH_X64);
+ EXPECT_FALSE(NULL == Engine.get());
+ String16 result = Engine->GetLibPathByVersion(String16("2.4"));
+ EXPECT_EQ(0, result.size());
+}
+
TEST(OpenCVEngineTest, InstallAndGetVersion)
{
sp<IOpenCVEngine> Engine = InitConnect();
Tests/PackageManagmentTest.cpp \
Tests/PackageInfoTest.cpp \
Tests/OpenCVEngineTest.cpp \
- Tests/TestMain.cpp
+ Tests/TestMain.cpp
# Tests/HardwareDetectionTest.cpp \
LOCAL_C_INCLUDES := \
$(TOP)/system/core/include
LOCAL_CFLAGS += -O0 -DGTEST_HAS_CLONE=0 -DGTEST_OS_LINUX_ANDROID=1 -DGTEST_HAS_TR1_TUPLE=0
+LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_V7A_FEATURES
#LOCAL_CFLAGS += -D__SUPPORT_TEGRA3
-#LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_V7A_FEATURES
#LOCAL_CFLAGS += -D__SUPPORT_ARMEABI_FEATURES
LOCAL_LDFLAGS = -Wl,-allow-shlib-undefined