Merge pull request #172 from asmorkalov:default_cam_lib_path

This commit is contained in:
Andrey Kamaev 2012-11-23 14:31:04 +04:00 committed by OpenCV Buildbot
commit f45b5b13f1
4 changed files with 14 additions and 10 deletions

View File

@ -5,10 +5,16 @@
#undef LOG_TAG
#define LOG_TAG "OpenCVEngine"
// OpenCV Engine API version
#ifndef OPEN_CV_ENGINE_VERSION
#define OPEN_CV_ENGINE_VERSION 2
#endif
#define LIB_OPENCV_INFO_NAME "libopencv_info.so"
// OpenCV Manager package name
#define OPENCV_ENGINE_PACKAGE "org.opencv.engine"
// Class name of OpenCV engine binder object. Is needned for connection to service
#define OPECV_ENGINE_CLASSNAME "org.opencv.engine.OpenCVEngineInterface"
#endif

View File

@ -4,11 +4,7 @@
#include <binder/IInterface.h>
#include <binder/Parcel.h>
#include <utils/String16.h>
// OpenCV Manager package name
#define OPENCV_ENGINE_PACKAGE "org.opencv.engine"
// Class name of OpenCV engine binder object. Is needned for connection to service
#define OPECV_ENGINE_CLASSNAME "org.opencv.engine.OpenCVEngineInterface"
#include "EngineCommon.h"
enum EngineMethonID
{

View File

@ -6,7 +6,7 @@ set(the_description "Auxiliary module for Android native camera support")
set(OPENCV_MODULE_TYPE STATIC)
ocv_define_module(androidcamera INTERNAL opencv_core log dl)
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/camera_wrapper")
ocv_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/camera_wrapper" "${OpenCV_SOURCE_DIR}/android/service/engine/jni/include")
# Android source tree for native camera
SET (ANDROID_SOURCE_TREE "ANDROID_SOURCE_TREE-NOTFOUND" CACHE PATH

View File

@ -9,6 +9,7 @@
#include <opencv2/core/version.hpp>
#include "camera_activity.hpp"
#include "camera_wrapper.h"
#include "EngineCommon.h"
#undef LOG_TAG
#undef LOGE
@ -267,12 +268,13 @@ void CameraWrapperConnector::fillListWrapperLibs(const string& folderPath, vecto
std::string CameraWrapperConnector::getDefaultPathLibFolder()
{
const string packageList[] = {"tegra3", "armv7a_neon", "armv7a", "armv5", "x86"};
for (size_t i = 0; i < 5; i++)
#define BIN_PACKAGE_NAME(x) "org.opencv.lib_v" CVAUX_STR(CV_MAJOR_VERSION) CVAUX_STR(CV_MINOR_VERSION) "_" x
const char* const packageList[] = {BIN_PACKAGE_NAME("armv7a"), OPENCV_ENGINE_PACKAGE};
for (size_t i = 0; i < sizeof(packageList)/sizeof(packageList[0]); i++)
{
char path[128];
sprintf(path, "/data/data/org.opencv.lib_v%d%d_%s/lib/", CV_MAJOR_VERSION, CV_MINOR_VERSION, packageList[i].c_str());
LOGD("Trying package \"%s\" (\"%s\")", packageList[i].c_str(), path);
sprintf(path, "/data/data/%s/lib/", packageList[i]);
LOGD("Trying package \"%s\" (\"%s\")", packageList[i], path);
DIR* dir = opendir(path);
if (!dir)