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
a39a9f67
Commit
a39a9f67
authored
Jun 10, 2013
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NativeActivity sample build with Eclipse CDT fixed.
parent
4cf7a963
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
75 additions
and
7 deletions
+75
-7
.cproject
samples/android/native-activity/.cproject
+0
-0
.project
samples/android/native-activity/.project
+68
-0
native.cpp
samples/android/native-activity/jni/native.cpp
+7
-7
No files found.
samples/android/native-activity/.cproject
View file @
a39a9f67
This diff is collapsed.
Click to expand it.
samples/android/native-activity/.project
View file @
a39a9f67
...
...
@@ -5,6 +5,64 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.cdt.managedbuilder.core.genmakebuilder
</name>
<triggers>
auto,full,incremental,
</triggers>
<arguments>
<dictionary>
<key>
?name?
</key>
<value></value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.append_environment
</key>
<value>
true
</value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.autoBuildTarget
</key>
<value></value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.buildArguments
</key>
<value></value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.buildCommand
</key>
<value>
"
${NDKROOT}/ndk-build.cmd
"
</value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.cleanBuildTarget
</key>
<value>
clean
</value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.contents
</key>
<value>
org.eclipse.cdt.make.core.activeConfigSettings
</value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.enableAutoBuild
</key>
<value>
true
</value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.enableCleanBuild
</key>
<value>
false
</value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.enableFullBuild
</key>
<value>
true
</value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.fullBuildTarget
</key>
<value></value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.stopOnError
</key>
<value>
true
</value>
</dictionary>
<dictionary>
<key>
org.eclipse.cdt.make.core.useDefaultBuildCmd
</key>
<value>
false
</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>
com.android.ide.eclipse.adt.ResourceManagerBuilder
</name>
<arguments>
...
...
@@ -25,9 +83,19 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
</name>
<triggers>
full,incremental,
</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
com.android.ide.eclipse.adt.AndroidNature
</nature>
<nature>
org.eclipse.jdt.core.javanature
</nature>
<nature>
org.eclipse.cdt.core.cnature
</nature>
<nature>
org.eclipse.cdt.core.ccnature
</nature>
<nature>
org.eclipse.cdt.managedbuilder.core.managedBuildNature
</nature>
<nature>
org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
</nature>
</natures>
</projectDescription>
samples/android/native-activity/jni/native.cpp
View file @
a39a9f67
...
...
@@ -9,7 +9,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <queue>
#include <opencv2/core/core.hpp>
...
...
@@ -60,7 +59,7 @@ static cv::Size calc_optimal_camera_resolution(const char* supported, int width,
}
}
idx
++
;
// to skip coma symbol
idx
++
;
// to skip com
m
a symbol
}
while
(
supported
[
idx
-
1
]
!=
'\0'
);
...
...
@@ -86,9 +85,9 @@ static void engine_draw_frame(Engine* engine, const cv::Mat& frame)
for
(
int
yy
=
top_indent
;
yy
<
std
::
min
(
frame
.
rows
+
top_indent
,
buffer
.
height
);
yy
++
)
{
unsigned
char
*
line
=
(
unsigned
char
*
)
pixels
;
memcpy
(
line
+
left_indent
*
4
*
sizeof
(
unsigned
char
),
frame
.
ptr
<
unsigned
char
>
(
yy
),
std
::
min
(
frame
.
cols
,
buffer
.
width
)
*
4
*
sizeof
(
unsigned
char
)
);
unsigned
char
*
line
=
(
unsigned
char
*
)
pixels
+
left_indent
*
4
*
sizeof
(
unsigned
char
)
;
size_t
line_size
=
std
::
min
(
frame
.
cols
,
buffer
.
width
)
*
4
*
sizeof
(
unsigned
char
);
memcpy
(
line
,
frame
.
ptr
<
unsigned
char
>
(
yy
),
line_size
);
// go to next line
pixels
=
(
int32_t
*
)
pixels
+
buffer
.
stride
;
}
...
...
@@ -139,7 +138,7 @@ static void engine_handle_cmd(android_app* app, int32_t cmd)
return
;
}
LOGI
(
"Camera initialized at resoution %dx%d"
,
camera_resolution
.
width
,
camera_resolution
.
height
);
LOGI
(
"Camera initialized at reso
l
ution %dx%d"
,
camera_resolution
.
width
,
camera_resolution
.
height
);
}
break
;
case
APP_CMD_TERM_WINDOW
:
...
...
@@ -157,7 +156,8 @@ void android_main(android_app* app)
// Make sure glue isn't stripped.
app_dummy
();
memset
(
&
engine
,
0
,
sizeof
(
engine
));
size_t
engine_size
=
sizeof
(
engine
);
// for Eclipse CDT parser
memset
((
void
*
)
&
engine
,
0
,
engine_size
);
app
->
userData
=
&
engine
;
app
->
onAppCmd
=
engine_handle_cmd
;
engine
.
app
=
app
;
...
...
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