Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
29b544d8
O
Opencv
项目概览
Greenplum
/
Opencv
大约 1 年 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
29b544d8
编写于
3月 22, 2013
作者:
A
Andrey Kamaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use cv::String in Android camera wrapper
上级
30888089
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
16 deletion
+18
-16
modules/androidcamera/src/camera_activity.cpp
modules/androidcamera/src/camera_activity.cpp
+18
-16
未找到文件。
modules/androidcamera/src/camera_activity.cpp
浏览文件 @
29b544d8
...
...
@@ -12,6 +12,8 @@
#include "camera_wrapper.h"
#include "EngineCommon.h"
#include "opencv2/core.hpp"
#undef LOG_TAG
#undef LOGE
#undef LOGD
...
...
@@ -37,17 +39,17 @@ public:
static
CameraActivity
::
ErrorCode
getProperty
(
void
*
camera
,
int
propIdx
,
double
*
value
);
static
CameraActivity
::
ErrorCode
applyProperties
(
void
**
ppcamera
);
static
void
setPathLibFolder
(
const
std
::
s
tring
&
path
);
static
void
setPathLibFolder
(
const
cv
::
S
tring
&
path
);
private:
static
std
::
s
tring
pathLibFolder
;
static
cv
::
S
tring
pathLibFolder
;
static
bool
isConnectedToLib
;
static
std
::
s
tring
getPathLibFolder
();
static
std
::
s
tring
getDefaultPathLibFolder
();
static
cv
::
S
tring
getPathLibFolder
();
static
cv
::
S
tring
getDefaultPathLibFolder
();
static
CameraActivity
::
ErrorCode
connectToLib
();
static
CameraActivity
::
ErrorCode
getSymbolFromLib
(
void
*
libHandle
,
const
char
*
symbolName
,
void
**
ppSymbol
);
static
void
fillListWrapperLibs
(
const
std
::
string
&
folderPath
,
std
::
vector
<
std
::
s
tring
>&
listLibs
);
static
void
fillListWrapperLibs
(
const
cv
::
String
&
folderPath
,
std
::
vector
<
cv
::
S
tring
>&
listLibs
);
static
InitCameraConnectC
pInitCameraC
;
static
CloseCameraConnectC
pCloseCameraC
;
...
...
@@ -58,7 +60,7 @@ private:
friend
bool
nextFrame
(
void
*
buffer
,
size_t
bufferSize
,
void
*
userData
);
};
std
::
s
tring
CameraWrapperConnector
::
pathLibFolder
;
cv
::
S
tring
CameraWrapperConnector
::
pathLibFolder
;
bool
CameraWrapperConnector
::
isConnectedToLib
=
false
;
InitCameraConnectC
CameraWrapperConnector
::
pInitCameraC
=
0
;
...
...
@@ -165,7 +167,7 @@ CameraActivity::ErrorCode CameraWrapperConnector::connectToLib()
}
dlerror
();
std
::
s
tring
folderPath
=
getPathLibFolder
();
cv
::
S
tring
folderPath
=
getPathLibFolder
();
if
(
folderPath
.
empty
())
{
LOGD
(
"Trying to find native camera in default OpenCV packages"
);
...
...
@@ -174,12 +176,12 @@ CameraActivity::ErrorCode CameraWrapperConnector::connectToLib()
LOGD
(
"CameraWrapperConnector::connectToLib: folderPath=%s"
,
folderPath
.
c_str
());
std
::
vector
<
std
::
s
tring
>
listLibs
;
std
::
vector
<
cv
::
S
tring
>
listLibs
;
fillListWrapperLibs
(
folderPath
,
listLibs
);
std
::
sort
(
listLibs
.
begin
(),
listLibs
.
end
(),
std
::
greater
<
std
::
s
tring
>
());
std
::
sort
(
listLibs
.
begin
(),
listLibs
.
end
(),
std
::
greater
<
cv
::
S
tring
>
());
void
*
libHandle
=
0
;
std
::
s
tring
cur_path
;
cv
::
S
tring
cur_path
;
for
(
size_t
i
=
0
;
i
<
listLibs
.
size
();
i
++
)
{
cur_path
=
folderPath
+
listLibs
[
i
];
LOGD
(
"try to load library '%s'"
,
listLibs
[
i
].
c_str
());
...
...
@@ -245,7 +247,7 @@ CameraActivity::ErrorCode CameraWrapperConnector::getSymbolFromLib(void* libHand
return
CameraActivity
::
NO_ERROR
;
}
void
CameraWrapperConnector
::
fillListWrapperLibs
(
const
std
::
string
&
folderPath
,
std
::
vector
<
std
::
s
tring
>&
listLibs
)
void
CameraWrapperConnector
::
fillListWrapperLibs
(
const
cv
::
String
&
folderPath
,
std
::
vector
<
cv
::
S
tring
>&
listLibs
)
{
DIR
*
dp
;
struct
dirent
*
ep
;
...
...
@@ -264,7 +266,7 @@ void CameraWrapperConnector::fillListWrapperLibs(const std::string& folderPath,
}
}
std
::
s
tring
CameraWrapperConnector
::
getDefaultPathLibFolder
()
cv
::
S
tring
CameraWrapperConnector
::
getDefaultPathLibFolder
()
{
#define BIN_PACKAGE_NAME(x) "org.opencv.lib_v" CVAUX_STR(CV_VERSION_EPOCH) CVAUX_STR(CV_VERSION_MAJOR) "_" x
const
char
*
const
packageList
[]
=
{
BIN_PACKAGE_NAME
(
"armv7a"
),
OPENCV_ENGINE_PACKAGE
};
...
...
@@ -287,10 +289,10 @@ std::string CameraWrapperConnector::getDefaultPathLibFolder()
}
}
return
std
::
s
tring
();
return
cv
::
S
tring
();
}
std
::
s
tring
CameraWrapperConnector
::
getPathLibFolder
()
cv
::
S
tring
CameraWrapperConnector
::
getPathLibFolder
()
{
if
(
!
pathLibFolder
.
empty
())
return
pathLibFolder
;
...
...
@@ -358,10 +360,10 @@ std::string CameraWrapperConnector::getPathLibFolder()
LOGE
(
"Could not get library name and base address"
);
}
return
std
::
s
tring
();
return
cv
::
S
tring
();
}
void
CameraWrapperConnector
::
setPathLibFolder
(
const
std
::
s
tring
&
path
)
void
CameraWrapperConnector
::
setPathLibFolder
(
const
cv
::
S
tring
&
path
)
{
pathLibFolder
=
path
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录