Removed info lib handling in OpenCV initialization on Android.

This commit is contained in:
Alexander Smorkalov 2023-12-04 15:00:36 +03:00
parent 70e55fd7c6
commit 1bf4f2386a

View File

@ -13,30 +13,10 @@ class StaticHelper {
String libs = "";
if(InitCuda)
{
loadLibrary("cudart");
loadLibrary("nppc");
loadLibrary("nppi");
loadLibrary("npps");
loadLibrary("cufft");
loadLibrary("cublas");
}
Log.w(TAG, "CUDA support was removed!");
Log.d(TAG, "Trying to get library list");
try
{
System.loadLibrary("opencv_info");
libs = getLibraryList();
}
catch(UnsatisfiedLinkError e)
{
Log.e(TAG, "OpenCV error: Cannot load info library for OpenCV");
}
Log.d(TAG, "Library list: \"" + libs + "\"");
Log.d(TAG, "First attempt to load libs");
if (initOpenCVLibs(libs))
if (loadLibrary("opencv_java4"))
{
Log.d(TAG, "First attempt to load libs is OK");
String eol = System.getProperty("line.separator");
@ -74,30 +54,6 @@ class StaticHelper {
return result;
}
private static boolean initOpenCVLibs(String Libs)
{
Log.d(TAG, "Trying to init OpenCV libs");
boolean result = true;
if ((null != Libs) && (Libs.length() != 0))
{
Log.d(TAG, "Trying to load libs by dependency list");
StringTokenizer splitter = new StringTokenizer(Libs, ";");
while(splitter.hasMoreTokens())
{
result &= loadLibrary(splitter.nextToken());
}
}
else
{
// If dependencies list is not defined or empty.
result = loadLibrary("opencv_java4");
}
return result;
}
private static final String TAG = "OpenCV/StaticHelper";
private static native String getLibraryList();