2014-05-20 08:19:23 +02:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <jni.h>
|
2014-05-30 09:58:19 +02:00
|
|
|
#include <unistd.h>
|
2014-05-20 08:19:23 +02:00
|
|
|
#include <android/log.h>
|
|
|
|
|
|
|
|
#define LOG_TAG "codec_unittest"
|
|
|
|
#define LOGI(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
|
|
|
|
|
2014-05-23 09:59:40 +02:00
|
|
|
int CodecUtMain(int argc, char** argv);
|
2014-05-20 08:19:23 +02:00
|
|
|
extern "C"
|
2014-05-23 09:59:40 +02:00
|
|
|
JNIEXPORT void JNICALL Java_com_cisco_codec_unittest_MainActivity_DoUnittest
|
2014-05-30 09:58:19 +02:00
|
|
|
(JNIEnv* env, jobject thiz, jstring directory, jstring jspath) {
|
2014-05-20 08:19:23 +02:00
|
|
|
/**************** Add the native codes/API *****************/
|
|
|
|
char* argv[2];
|
|
|
|
int argc = 2;
|
|
|
|
argv[0] = (char*) ("codec_unittest.exe");
|
|
|
|
argv[1] = (char*) ((*env).GetStringUTFChars (jspath,NULL));
|
2014-05-30 09:58:19 +02:00
|
|
|
chdir((*env).GetStringUTFChars (directory, NULL));
|
2014-05-30 09:07:06 +02:00
|
|
|
LOGI ("PATH: %s", argv[1]);
|
2014-05-20 08:19:23 +02:00
|
|
|
LOGI ("Start to run JNI module!+++");
|
|
|
|
CodecUtMain(argc,argv);
|
|
|
|
LOGI ("End to run JNI module!+++");
|
|
|
|
}
|
|
|
|
|
|
|
|
|