3 #include <android/log.h>
9 static jstring gst_native_get_gstreamer_info (JNIEnv* env, jobject thiz) {
10 char *version_utf8 = gst_version_string();
11 jstring *version_jstring = (*env)->NewStringUTF(env, version_utf8);
12 g_free (version_utf8);
13 return version_jstring;
16 static JNINativeMethod native_methods[] = {
17 { "nativeGetGStreamerInfo", "()Ljava/lang/String;", (void *) gst_native_get_gstreamer_info}
20 jint JNI_OnLoad(JavaVM *vm, void *reserved) {
23 if ((*vm)->GetEnv(vm, (void**) &env, JNI_VERSION_1_4) != JNI_OK) {
24 __android_log_print (ANDROID_LOG_ERROR, "tutorial-1", "Could not retrieve JNIEnv");
27 jclass klass = (*env)->FindClass (env, "org/freedesktop/gstreamer/tutorials/tutorial_1/Tutorial1");
28 (*env)->RegisterNatives (env, klass, native_methods, G_N_ELEMENTS(native_methods));
30 return JNI_VERSION_1_4;