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
c8a603d8
Commit
c8a603d8
authored
Jul 14, 2011
by
Leonid Beynenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in the function of search of Android applicvation path.
parent
b16fb5d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
camera_activity.cpp
modules/androidcamera/src/camera_activity.cpp
+7
-6
No files found.
modules/androidcamera/src/camera_activity.cpp
View file @
c8a603d8
...
...
@@ -264,6 +264,10 @@ std::string CameraWrapperConnector::getPathLibFolder()
sprintf
(
addrBuf
,
"%p-"
,
dl_info
.
dli_fbase
);
int
addrLength
=
strlen
(
addrBuf
);
const
char
*
libName
=
dl_info
.
dli_fname
;
while
(
((
*
libName
)
==
'/'
)
||
((
*
libName
)
==
'.'
)
)
libName
++
;
char
lineBuf
[
2048
];
FILE
*
file
=
fopen
(
"/proc/self/smaps"
,
"rt"
);
...
...
@@ -271,11 +275,9 @@ std::string CameraWrapperConnector::getPathLibFolder()
{
while
(
fgets
(
lineBuf
,
sizeof
lineBuf
,
file
)
!=
NULL
)
{
if
(
0
==
strncmp
(
lineBuf
,
addrBuf
,
addrLength
))
{
//verify that line ends with library name
int
lineLength
=
strlen
(
lineBuf
);
int
libNameLength
=
strlen
(
dl_info
.
dli_fn
ame
);
int
libNameLength
=
strlen
(
libN
ame
);
//trim end
for
(
int
i
=
lineLength
-
1
;
i
>=
0
&&
isspace
(
lineBuf
[
i
]);
--
i
)
...
...
@@ -284,9 +286,9 @@ std::string CameraWrapperConnector::getPathLibFolder()
--
lineLength
;
}
if
(
0
!=
strncmp
(
lineBuf
+
lineLength
-
libNameLength
,
dl_info
.
dli_fn
ame
,
libNameLength
))
if
(
0
!=
strncmp
(
lineBuf
+
lineLength
-
libNameLength
,
libN
ame
,
libNameLength
))
{
LOGE
(
"Strange error: line
\"
%s
\"
does not ends with library name %s"
,
lineBuf
,
dl_info
.
dli_fname
);
//the line does not contain the library name
continue
;
}
...
...
@@ -305,7 +307,6 @@ std::string CameraWrapperConnector::getPathLibFolder()
fclose
(
file
);
return
pathBegin
;
}
}
fclose
(
file
);
LOGE
(
"Could not find library 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