Commit a75fbb00 authored by Roman Donchenko's avatar Roman Donchenko Committed by OpenCV Buildbot

Merge pull request #968 from asmorkalov:android_na_cproj_fix

parents d583a798 a39a9f67
This diff is collapsed.
...@@ -5,6 +5,64 @@ ...@@ -5,6 +5,64 @@
<projects> <projects>
</projects> </projects>
<buildSpec> <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>&quot;${NDKROOT}/ndk-build.cmd&quot;</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> <buildCommand>
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> <name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
<arguments> <arguments>
...@@ -25,9 +83,19 @@ ...@@ -25,9 +83,19 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>com.android.ide.eclipse.adt.AndroidNature</nature> <nature>com.android.ide.eclipse.adt.AndroidNature</nature>
<nature>org.eclipse.jdt.core.javanature</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> </natures>
</projectDescription> </projectDescription>
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <float.h>
#include <queue> #include <queue>
#include <opencv2/core/core.hpp> #include <opencv2/core/core.hpp>
...@@ -60,7 +59,7 @@ static cv::Size calc_optimal_camera_resolution(const char* supported, int width, ...@@ -60,7 +59,7 @@ static cv::Size calc_optimal_camera_resolution(const char* supported, int width,
} }
} }
idx++; // to skip coma symbol idx++; // to skip comma symbol
} while(supported[idx-1] != '\0'); } while(supported[idx-1] != '\0');
...@@ -86,9 +85,9 @@ static void engine_draw_frame(Engine* engine, const cv::Mat& frame) ...@@ -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++) for (int yy = top_indent; yy < std::min(frame.rows+top_indent, buffer.height); yy++)
{ {
unsigned char* line = (unsigned char*)pixels; unsigned char* line = (unsigned char*)pixels + left_indent*4*sizeof(unsigned char);
memcpy(line+left_indent*4*sizeof(unsigned char), frame.ptr<unsigned char>(yy), size_t line_size = std::min(frame.cols, buffer.width)*4*sizeof(unsigned char);
std::min(frame.cols, buffer.width)*4*sizeof(unsigned char)); memcpy(line, frame.ptr<unsigned char>(yy), line_size);
// go to next line // go to next line
pixels = (int32_t*)pixels + buffer.stride; pixels = (int32_t*)pixels + buffer.stride;
} }
...@@ -139,7 +138,7 @@ static void engine_handle_cmd(android_app* app, int32_t cmd) ...@@ -139,7 +138,7 @@ static void engine_handle_cmd(android_app* app, int32_t cmd)
return; return;
} }
LOGI("Camera initialized at resoution %dx%d", camera_resolution.width, camera_resolution.height); LOGI("Camera initialized at resolution %dx%d", camera_resolution.width, camera_resolution.height);
} }
break; break;
case APP_CMD_TERM_WINDOW: case APP_CMD_TERM_WINDOW:
...@@ -157,7 +156,8 @@ void android_main(android_app* app) ...@@ -157,7 +156,8 @@ void android_main(android_app* app)
// Make sure glue isn't stripped. // Make sure glue isn't stripped.
app_dummy(); 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->userData = &engine;
app->onAppCmd = engine_handle_cmd; app->onAppCmd = engine_handle_cmd;
engine.app = app; engine.app = app;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment