• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #include <string.h>
2 #include <stdlib.h>
3 #include <stdio.h>
4 #include <jni.h>
5 #include <unistd.h>
6 #include <android/log.h>
7 
8 #define LOG_TAG "codec_unittest"
9 #define LOGI(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
10 
11 int CodecUtMain (int argc, char** argv);
12 extern "C"
Java_com_cisco_codec_unittest_MainActivity_DoUnittest(JNIEnv * env,jobject thiz,jstring directory,jstring jspath)13 JNIEXPORT void JNICALL Java_com_cisco_codec_unittest_MainActivity_DoUnittest
14 (JNIEnv* env, jobject thiz, jstring directory, jstring jspath) {
15   /**************** Add the native codes/API *****************/
16   char* argv[2];
17   int  argc = 2;
18   argv[0] = (char*) ("codec_unittest.exe");
19   argv[1] = (char*) ((*env).GetStringUTFChars (jspath, NULL));
20   chdir ((*env).GetStringUTFChars (directory, NULL));
21   LOGI ("PATH: %s", argv[1]);
22   LOGI ("Start to run JNI module!+++");
23   CodecUtMain (argc, argv);
24   LOGI ("End to run JNI module!+++");
25 }
26 
27 
28