giving the android jni a start up function OnLoad

This commit is contained in:
Ethan Rublee 2010-09-26 18:12:42 +00:00
parent 91b5c97d8d
commit 50df762c4e
4 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,2 @@
# The ARMv7 is significanly faster due to the use of the hardware FPU
APP_ABI := armeabi armeabi-v7a
APP_BUILD_SCRIPT := $(call my-dir)/Android.mk
APP_PROJECT_PATH := $(PROJECT_PATH)
APP_MODULES := android-opencv

View File

@ -34,6 +34,7 @@ using namespace cv;
}
%}
%pragma(java) jniclasscode=%{
static {
try {
@ -48,6 +49,7 @@ using namespace cv;
}
%}
%include "cv.i"
%include "glcamera.i"

View File

@ -5,6 +5,16 @@
#include <android/log.h>
#include <opencv2/imgproc/imgproc.hpp>
#define LOG_TAG "libandroid-opencv"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved)
{
JNIEnv *env;
LOGI("JNI_OnLoad called for opencv");
return JNI_VERSION_1_4;
}
JNIEXPORT void JNICALL Java_com_opencv_jni_opencvJNI_addYUVtoPool(JNIEnv * env,
jclass thiz, jlong ppool, jobject _jpool, jbyteArray jbuffer,

View File

@ -9,7 +9,7 @@ using namespace cv;
extern "C" {
#endif
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved);
//
//JNIEXPORT jobject JNICALL Java_com_opencv_jni_opencvJNI_getBitmapBuffer(
// JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_);