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
29b544d8
Commit
29b544d8
authored
Mar 22, 2013
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use cv::String in Android camera wrapper
parent
30888089
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
camera_activity.cpp
modules/androidcamera/src/camera_activity.cpp
+18
-16
No files found.
modules/androidcamera/src/camera_activity.cpp
View file @
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
;
}
...
...
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