1 #include <string.h>
2 #include <stdlib.h>
3 #include <jni.h>
4 #include <android/log.h>
5
6 #define LOG_TAG "welsdec"
7 #define LOGI(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
8
9 extern int DecMain (int argc, char* argv[]);
10 extern "C"
Java_com_wels_dec_WelsDecTest_DoDecoderTest(JNIEnv * env,jobject thiz,jstring jsFileNameIn,jstring jsFileNameOut)11 JNIEXPORT void JNICALL Java_com_wels_dec_WelsDecTest_DoDecoderTest
12 (JNIEnv* env, jobject thiz, jstring jsFileNameIn, jstring jsFileNameOut) {
13 /**************** Add the native codes/API *****************/
14 char* argv[3];
15 int argc = 3;
16 argv[0] = (char*) ("decConsole.exe");
17 argv[1] = (char*) ((*env).GetStringUTFChars (jsFileNameIn, NULL));
18 argv[2] = (char*) ((*env).GetStringUTFChars (jsFileNameOut, NULL));
19 LOGI ("Start to run JNI module!+++");
20 DecMain (argc, argv);
21 LOGI ("End to run JNI module!+++");
22 }
23
24
25