giving the android jni a start up function OnLoad
This commit is contained in:
parent
91b5c97d8d
commit
50df762c4e
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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,
|
||||
|
@ -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_);
|
||||
|
Loading…
x
Reference in New Issue
Block a user