I am calling a JNI function with int values as parameters. I am sending width and height as 800 and 480. But when I try to print these values in the JNI function I am getting 1 and 0 instead of 800 and 480. Why I am getting wrong values in JNI?
My JNI function call is:
findSquare(sourceImage.getNativeObjAddr(),
imageTaken.getNativeObjAddr(), 1, width, height);
public native void findSquare(long matAddrRgba, long matAddrDescriptor,
int draw, int width, int height);
And the JNI function is:
JNIEXPORT jint JNICALL
Java_info_androidhive_androidcameraapi_CameraMainActivity_findSquare(
JNIEnv*, jobject, jlong addrRgba, jlong addrDescriptor, jlong addrSrc,
jlong addrDst, jint draw, jint width, jint height);
addrSrcandaddrDst?(long, long, int, int, int)on the Java side and(jlong, jlong, jlong, jint, jint, jint)on the JNI side. Reconcile this.JNIEnv*and thejobject.