Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
293063ee
Commit
293063ee
authored
Oct 24, 2012
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code normalization problems fixed.
Rair hangs on library installation fixed.
parent
680fba7e
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
42 additions
and
53 deletions
+42
-53
BnOpenCVEngine.cpp
...oid/service/engine/jni/BinderComponent/BnOpenCVEngine.cpp
+0
-2
HardwareDetector.cpp
...d/service/engine/jni/BinderComponent/HardwareDetector.cpp
+7
-7
OpenCVEngine.cpp
android/service/engine/jni/BinderComponent/OpenCVEngine.cpp
+2
-10
ProcReader.cpp
android/service/engine/jni/BinderComponent/ProcReader.cpp
+0
-0
StringUtils.cpp
android/service/engine/jni/BinderComponent/StringUtils.cpp
+0
-1
TegraDetector.cpp
android/service/engine/jni/BinderComponent/TegraDetector.cpp
+0
-0
JavaBasedPackageManager.cpp
...service/engine/jni/JNIWrapper/JavaBasedPackageManager.cpp
+2
-2
OpenCVEngine_jni.cpp
android/service/engine/jni/JNIWrapper/OpenCVEngine_jni.cpp
+0
-1
ClientMain.cpp
android/service/engine/jni/NativeClient/ClientMain.cpp
+0
-0
CommonPackageManager.cpp
...service/engine/jni/NativeService/CommonPackageManager.cpp
+2
-1
PackageInfo.cpp
android/service/engine/jni/NativeService/PackageInfo.cpp
+28
-28
OpenCVEngineTest.cpp
android/service/engine/jni/Tests/OpenCVEngineTest.cpp
+1
-1
No files found.
android/service/engine/jni/BinderComponent/BnOpenCVEngine.cpp
View file @
293063ee
...
@@ -60,9 +60,7 @@ status_t BnOpenCVEngine::onTransact(uint32_t code, const Parcel& data, android::
...
@@ -60,9 +60,7 @@ status_t BnOpenCVEngine::onTransact(uint32_t code, const Parcel& data, android::
int
res
=
reply
->
writeInt32
(
static_cast
<
int32_t
>
(
result
));
int
res
=
reply
->
writeInt32
(
static_cast
<
int32_t
>
(
result
));
LOGD
(
"InstallVersion call to Binder finished with res %d"
,
res
);
LOGD
(
"InstallVersion call to Binder finished with res %d"
,
res
);
return
res
;
return
res
;
}
break
;
}
break
;
default
:
default
:
{
{
LOGD
(
"OpenCVEngine unknown request"
);
LOGD
(
"OpenCVEngine unknown request"
);
...
...
android/service/engine/jni/BinderComponent/HardwareDetector.cpp
View file @
293063ee
...
@@ -13,7 +13,7 @@ int GetCpuID()
...
@@ -13,7 +13,7 @@ int GetCpuID()
map
<
string
,
string
>
cpu_info
=
GetCpuInfo
();
map
<
string
,
string
>
cpu_info
=
GetCpuInfo
();
map
<
string
,
string
>::
const_iterator
it
;
map
<
string
,
string
>::
const_iterator
it
;
#if defined(__i386__)
#if defined(__i386__)
LOGD
(
"Using X86 HW detector"
);
LOGD
(
"Using X86 HW detector"
);
result
|=
ARCH_X86
;
result
|=
ARCH_X86
;
it
=
cpu_info
.
find
(
"flags"
);
it
=
cpu_info
.
find
(
"flags"
);
...
@@ -34,11 +34,11 @@ int GetCpuID()
...
@@ -34,11 +34,11 @@ int GetCpuID()
}
}
}
}
#elif defined(__mips)
#elif defined(__mips)
#ifdef __SUPPORT_MIPS
#ifdef __SUPPORT_MIPS
result
|=
ARCH_MIPS
;
result
|=
ARCH_MIPS
;
#else
#else
result
=
ARCH_UNKNOWN
;
result
=
ARCH_UNKNOWN
;
#endif
#endif
#else
#else
LOGD
(
"Using ARM HW detector"
);
LOGD
(
"Using ARM HW detector"
);
it
=
cpu_info
.
find
(
"Processor"
);
it
=
cpu_info
.
find
(
"Processor"
);
...
@@ -103,7 +103,7 @@ int GetCpuID()
...
@@ -103,7 +103,7 @@ int GetCpuID()
}
}
}
}
}
}
#endif
#endif
return
result
;
return
result
;
}
}
...
@@ -174,8 +174,8 @@ int DetectKnownPlatforms()
...
@@ -174,8 +174,8 @@ int DetectKnownPlatforms()
// NOTE: Uncomment when all Tegras will be supported
// NOTE: Uncomment when all Tegras will be supported
/*if (tegra_status > 0)
/*if (tegra_status > 0)
{
*
{
return PLATFORM_TEGRA + tegra_status - 1;
*
return PLATFORM_TEGRA + tegra_status - 1;
}
}
else
else
{
{
...
...
android/service/engine/jni/BinderComponent/OpenCVEngine.cpp
View file @
293063ee
...
@@ -173,24 +173,16 @@ bool OpenCVEngine::InstallVersion(android::String16 version)
...
@@ -173,24 +173,16 @@ bool OpenCVEngine::InstallVersion(android::String16 version)
std
::
string
norm_version
;
std
::
string
norm_version
;
bool
result
=
false
;
bool
result
=
false
;
LOGD
(
"OpenCVEngine::InstallVersion() begin"
);
norm_version
=
NormalizeVersionString
(
std_version
);
norm_version
=
NormalizeVersionString
(
std_version
);
if
(
!
norm_version
.
empty
())
if
(
!
norm_version
.
empty
())
{
LOGD
(
"OpenCVEngine::InstallVersion() begin"
);
if
(
!
PackageManager
->
CheckVersionInstalled
(
norm_version
,
Platform
,
CpuID
))
{
{
LOGD
(
"PackageManager->InstallVersion call"
);
LOGD
(
"PackageManager->InstallVersion call"
);
result
=
PackageManager
->
InstallVersion
(
norm_version
,
Platform
,
CpuID
);
result
=
PackageManager
->
InstallVersion
(
norm_version
,
Platform
,
CpuID
);
}
}
else
else
{
LOGI
(
"Package OpenCV of version %s is already installed. Skiped."
,
norm_version
.
c_str
());
result
=
true
;
}
}
else
{
{
LOGE
(
"OpenCV version
\"
%s
\"
is not supported"
,
norm_version
.
c_str
());
LOGE
(
"OpenCV version
\"
%s
\"
is not supported"
,
norm_version
.
c_str
());
}
}
...
...
android/service/engine/jni/BinderComponent/ProcReader.cpp
View file @
293063ee
android/service/engine/jni/BinderComponent/StringUtils.cpp
View file @
293063ee
...
@@ -52,7 +52,6 @@ bool ParseString(const string& src, string& key, string& value)
...
@@ -52,7 +52,6 @@ bool ParseString(const string& src, string& key, string& value)
set
<
string
>
SplitString
(
const
string
&
src
,
const
char
seporator
)
set
<
string
>
SplitString
(
const
string
&
src
,
const
char
seporator
)
{
{
set
<
string
>
result
;
set
<
string
>
result
;
if
(
!
src
.
empty
())
if
(
!
src
.
empty
())
...
...
android/service/engine/jni/BinderComponent/TegraDetector.cpp
View file @
293063ee
android/service/engine/jni/JNIWrapper/JavaBasedPackageManager.cpp
View file @
293063ee
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
using
namespace
std
;
using
namespace
std
;
JavaBasedPackageManager
::
JavaBasedPackageManager
(
JavaVM
*
JavaMashine
,
jobject
MarketConnector
)
:
JavaBasedPackageManager
::
JavaBasedPackageManager
(
JavaVM
*
JavaMashine
,
jobject
MarketConnector
)
:
JavaContext
(
JavaMashine
),
JavaContext
(
JavaMashine
),
JavaPackageManager
(
MarketConnector
)
JavaPackageManager
(
MarketConnector
)
{
{
assert
(
JavaContext
);
assert
(
JavaContext
);
assert
(
JavaPackageManager
);
assert
(
JavaPackageManager
);
...
...
android/service/engine/jni/JNIWrapper/OpenCVEngine_jni.cpp
View file @
293063ee
...
@@ -67,4 +67,3 @@ JNIEXPORT void JNICALL Java_org_opencv_engine_BinderConnector_Final(JNIEnv *, jo
...
@@ -67,4 +67,3 @@ JNIEXPORT void JNICALL Java_org_opencv_engine_BinderConnector_Final(JNIEnv *, jo
delete
PackageManager
;
delete
PackageManager
;
PackageManager
=
NULL
;
PackageManager
=
NULL
;
}
}
android/service/engine/jni/NativeClient/ClientMain.cpp
View file @
293063ee
android/service/engine/jni/NativeService/CommonPackageManager.cpp
View file @
293063ee
...
@@ -41,7 +41,8 @@ bool CommonPackageManager::CheckVersionInstalled(const std::string& version, int
...
@@ -41,7 +41,8 @@ bool CommonPackageManager::CheckVersionInstalled(const std::string& version, int
if
(
!
packages
.
empty
())
if
(
!
packages
.
empty
())
{
{
result
=
(
packages
.
end
()
!=
find
(
packages
.
begin
(),
packages
.
end
(),
target_package
));
vector
<
PackageInfo
>::
const_iterator
it
=
find
(
packages
.
begin
(),
packages
.
end
(),
target_package
);
result
=
(
it
!=
packages
.
end
());
}
}
LOGD
(
"CommonPackageManager::CheckVersionInstalled() end"
);
LOGD
(
"CommonPackageManager::CheckVersionInstalled() end"
);
return
result
;
return
result
;
...
...
android/service/engine/jni/NativeService/PackageInfo.cpp
View file @
293063ee
...
@@ -189,14 +189,14 @@ inline int SplitPlatfrom(const vector<string>& features)
...
@@ -189,14 +189,14 @@ inline int SplitPlatfrom(const vector<string>& features)
* Example: armv7_neon, armv5_vfpv3
* Example: armv7_neon, armv5_vfpv3
*/
*/
PackageInfo
::
PackageInfo
(
const
string
&
version
,
int
platform
,
int
cpu_id
,
std
::
string
install_path
)
:
PackageInfo
::
PackageInfo
(
const
string
&
version
,
int
platform
,
int
cpu_id
,
std
::
string
install_path
)
:
Version
(
version
),
Version
(
version
),
Platform
(
platform
),
Platform
(
platform
),
CpuID
(
cpu_id
),
CpuID
(
cpu_id
),
InstallPath
(
""
)
InstallPath
(
""
)
{
{
#ifndef __SUPPORT_TEGRA3
#ifndef __SUPPORT_TEGRA3
Platform
=
PLATFORM_UNKNOWN
;
Platform
=
PLATFORM_UNKNOWN
;
#endif
#endif
FullName
=
BasePackageName
+
"_v"
+
Version
.
substr
(
0
,
Version
.
size
()
-
1
);
FullName
=
BasePackageName
+
"_v"
+
Version
.
substr
(
0
,
Version
.
size
()
-
1
);
if
(
PLATFORM_UNKNOWN
!=
Platform
)
if
(
PLATFORM_UNKNOWN
!=
Platform
)
{
{
...
@@ -210,41 +210,41 @@ PackageInfo::PackageInfo(const string& version, int platform, int cpu_id, std::s
...
@@ -210,41 +210,41 @@ PackageInfo::PackageInfo(const string& version, int platform, int cpu_id, std::s
{
{
LOGD
(
"PackageInfo::PackageInfo: package arch x86"
);
LOGD
(
"PackageInfo::PackageInfo: package arch x86"
);
FullName
+=
string
(
"_"
)
+
ARCH_X86_NAME
;
FullName
+=
string
(
"_"
)
+
ARCH_X86_NAME
;
#ifdef __SUPPORT_INTEL_FEATURES
#ifdef __SUPPORT_INTEL_FEATURES
string
features
=
JoinIntelFeatures
(
CpuID
);
string
features
=
JoinIntelFeatures
(
CpuID
);
if
(
!
features
.
empty
())
if
(
!
features
.
empty
())
{
{
FullName
+=
string
(
"_"
)
+
features
;
FullName
+=
string
(
"_"
)
+
features
;
}
}
#endif
#endif
}
}
else
if
(
ARCH_X64
&
CpuID
)
else
if
(
ARCH_X64
&
CpuID
)
{
{
LOGD
(
"PackageInfo::PackageInfo: package arch x64"
);
LOGD
(
"PackageInfo::PackageInfo: package arch x64"
);
#ifdef __SUPPORT_INTEL_x64
#ifdef __SUPPORT_INTEL_x64
FullName
+=
string
(
"_"
)
+
ARCH_X64_NAME
;
FullName
+=
string
(
"_"
)
+
ARCH_X64_NAME
;
#else
#else
FullName
+=
string
(
"_"
)
+
ARCH_X86_NAME
;
FullName
+=
string
(
"_"
)
+
ARCH_X86_NAME
;
#endif
#endif
#ifdef __SUPPORT_INTEL_FEATURES
#ifdef __SUPPORT_INTEL_FEATURES
string
features
=
JoinIntelFeatures
(
CpuID
);
string
features
=
JoinIntelFeatures
(
CpuID
);
if
(
!
features
.
empty
())
if
(
!
features
.
empty
())
{
{
FullName
+=
string
(
"_"
)
+
features
;
FullName
+=
string
(
"_"
)
+
features
;
}
}
#endif
#endif
}
}
else
if
(
ARCH_ARMv5
&
CpuID
)
else
if
(
ARCH_ARMv5
&
CpuID
)
{
{
LOGD
(
"PackageInfo::PackageInfo: package arch ARMv5"
);
LOGD
(
"PackageInfo::PackageInfo: package arch ARMv5"
);
FullName
+=
string
(
"_"
)
+
ARCH_ARMv5_NAME
;
FullName
+=
string
(
"_"
)
+
ARCH_ARMv5_NAME
;
#ifdef __SUPPORT_ARMEABI_FEATURES
#ifdef __SUPPORT_ARMEABI_FEATURES
string
features
=
JoinARMFeatures
(
CpuID
);
string
features
=
JoinARMFeatures
(
CpuID
);
if
(
!
features
.
empty
())
if
(
!
features
.
empty
())
{
{
FullName
+=
string
(
"_"
)
+
features
;
FullName
+=
string
(
"_"
)
+
features
;
}
}
#endif
#endif
}
}
else
if
(
ARCH_ARMv6
&
CpuID
)
else
if
(
ARCH_ARMv6
&
CpuID
)
{
{
...
@@ -252,46 +252,46 @@ PackageInfo::PackageInfo(const string& version, int platform, int cpu_id, std::s
...
@@ -252,46 +252,46 @@ PackageInfo::PackageInfo(const string& version, int platform, int cpu_id, std::s
// NOTE: ARM v5 used instead ARM v6
// NOTE: ARM v5 used instead ARM v6
//FullName += string("_") + ARCH_ARMv6_NAME;
//FullName += string("_") + ARCH_ARMv6_NAME;
FullName
+=
string
(
"_"
)
+
ARCH_ARMv5_NAME
;
FullName
+=
string
(
"_"
)
+
ARCH_ARMv5_NAME
;
#ifdef __SUPPORT_ARMEABI_FEATURES
#ifdef __SUPPORT_ARMEABI_FEATURES
string
features
=
JoinARMFeatures
(
CpuID
);
string
features
=
JoinARMFeatures
(
CpuID
);
if
(
!
features
.
empty
())
if
(
!
features
.
empty
())
{
{
FullName
+=
string
(
"_"
)
+
features
;
FullName
+=
string
(
"_"
)
+
features
;
}
}
#endif
#endif
}
}
else
if
(
ARCH_ARMv7
&
CpuID
)
else
if
(
ARCH_ARMv7
&
CpuID
)
{
{
LOGD
(
"PackageInfo::PackageInfo: package arch ARMv7"
);
LOGD
(
"PackageInfo::PackageInfo: package arch ARMv7"
);
FullName
+=
string
(
"_"
)
+
ARCH_ARMv7_NAME
;
FullName
+=
string
(
"_"
)
+
ARCH_ARMv7_NAME
;
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
#ifdef __SUPPORT_ARMEABI_V7A_FEATURES
string
features
=
JoinARMFeatures
(
CpuID
);
string
features
=
JoinARMFeatures
(
CpuID
);
if
(
!
features
.
empty
())
if
(
!
features
.
empty
())
{
{
FullName
+=
string
(
"_"
)
+
features
;
FullName
+=
string
(
"_"
)
+
features
;
}
}
#endif
#endif
}
}
else
if
(
ARCH_ARMv8
&
CpuID
)
else
if
(
ARCH_ARMv8
&
CpuID
)
{
{
LOGD
(
"PackageInfo::PackageInfo: package arch ARMv8"
);
LOGD
(
"PackageInfo::PackageInfo: package arch ARMv8"
);
#ifdef __SUPPORT_ARMEABI_V8
#ifdef __SUPPORT_ARMEABI_V8
FullName
+=
string
(
"_"
)
+
ARCH_ARMv8_NAME
;
FullName
+=
string
(
"_"
)
+
ARCH_ARMv8_NAME
;
#else
#else
FullName
+=
string
(
"_"
)
+
ARCH_ARMv7_NAME
;
FullName
+=
string
(
"_"
)
+
ARCH_ARMv7_NAME
;
#endif
#endif
//string features = JoinARMFeatures(CpuID);
//string features = JoinARMFeatures(CpuID);
//if (!features.empty())
//if (!features.empty())
//{
//{
// FullName += string("_") + features;
// FullName += string("_") + features;
//}
//}
}
}
#ifdef __SUPPORT_MIPS
#ifdef __SUPPORT_MIPS
else
if
(
ARCH_MIPS
&
CpuID
)
else
if
(
ARCH_MIPS
&
CpuID
)
{
{
FullName
+=
string
(
"_"
)
+
ARCH_MIPS_NAME
;
FullName
+=
string
(
"_"
)
+
ARCH_MIPS_NAME
;
}
}
#endif
#endif
else
else
{
{
LOGD
(
"PackageInfo::PackageInfo: package arch unknown"
);
LOGD
(
"PackageInfo::PackageInfo: package arch unknown"
);
...
@@ -316,8 +316,8 @@ PackageInfo::PackageInfo(const string& version, int platform, int cpu_id, std::s
...
@@ -316,8 +316,8 @@ PackageInfo::PackageInfo(const string& version, int platform, int cpu_id, std::s
}
}
PackageInfo
::
PackageInfo
(
const
string
&
fullname
,
const
string
&
install_path
,
string
package_version
)
:
PackageInfo
::
PackageInfo
(
const
string
&
fullname
,
const
string
&
install_path
,
string
package_version
)
:
FullName
(
fullname
),
FullName
(
fullname
),
InstallPath
(
install_path
)
InstallPath
(
install_path
)
{
{
LOGD
(
"PackageInfo::PackageInfo(
\"
%s
\"
,
\"
%s
\"
,
\"
%s
\"
)"
,
fullname
.
c_str
(),
install_path
.
c_str
(),
package_version
.
c_str
());
LOGD
(
"PackageInfo::PackageInfo(
\"
%s
\"
,
\"
%s
\"
,
\"
%s
\"
)"
,
fullname
.
c_str
(),
install_path
.
c_str
(),
package_version
.
c_str
());
...
@@ -424,12 +424,12 @@ PackageInfo::PackageInfo(const string& fullname, const string& install_path, str
...
@@ -424,12 +424,12 @@ PackageInfo::PackageInfo(const string& fullname, const string& install_path, str
{
{
CpuID
=
ARCH_X64
|
SplitIntelFeatures
(
features
);
CpuID
=
ARCH_X64
|
SplitIntelFeatures
(
features
);
}
}
#ifdef __SUPPORT_MIPS
#ifdef __SUPPORT_MIPS
else
if
(
ARCH_MIPS_NAME
==
features
[
2
])
else
if
(
ARCH_MIPS_NAME
==
features
[
2
])
{
{
CpuID
=
ARCH_MIPS
;
CpuID
=
ARCH_MIPS
;
}
}
#endif
#endif
else
else
{
{
LOGD
(
"It is not OpenCV library package for this platform"
);
LOGD
(
"It is not OpenCV library package for this platform"
);
...
...
android/service/engine/jni/Tests/OpenCVEngineTest.cpp
View file @
293063ee
...
@@ -126,7 +126,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWNewVersion)
...
@@ -126,7 +126,7 @@ TEST(OpenCVEngineTest, GetPathForExecHWNewVersion)
EXPECT_EQ
(
0
,
result
.
size
());
EXPECT_EQ
(
0
,
result
.
size
());
}
}
#else
#else
// armeabi
TEST
(
OpenCVEngineTest
,
GetPathForExecHWExistVersion
)
TEST
(
OpenCVEngineTest
,
GetPathForExecHWExistVersion
)
{
{
sp
<
IOpenCVEngine
>
Engine
=
InitConnect
();
sp
<
IOpenCVEngine
>
Engine
=
InitConnect
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment