Skip to content

Instantly share code, notes, and snippets.

@lhjnano
Created December 21, 2016 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lhjnano/017644d5b44d9962a83d13fbde09f7b4 to your computer and use it in GitHub Desktop.
Save lhjnano/017644d5b44d9962a83d13fbde09f7b4 to your computer and use it in GitHub Desktop.
JNIEXPORT jint JNICALL Java_com_gluesys_util_NDKAdapter_run_1ffmpeg(JNIEnv *env, jobject obj, jobjectArray cmdLines)
{
jstring jstr;
jsize len = (*env)->GetArrayLength(env, cmdLines);
char **argv = (char **) malloc(len*sizeof(char *));
int i=0;
for (i=0 ; i<len; i++) {
jstr = (*env)->GetObjectArrayElement(env, cmdLines, i);
argv[i] = (char *)(*env)->GetStringUTFChars(env, jstr, 0);
}
LOGI("call run_ffmpeg");
if( len > 0)
run_ffmpeg(len, argv);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment