In JNI_OnLoad() we will already get the Java VM passed and could
just directly use that. gstreamer_android-1.0.c will now provide
this to us.
Reason for this is that apparently not all Android system are
providing the JNI functions to get the currently running Java VMs, so
we would fail to get. With this we will always be able to get the Java
VM on such systems.
jsize n_vms;
gint ret;
+ if (java_vm) {
+ GST_DEBUG ("Java VM already provided by the application");
+ return TRUE;
+ }
+
/* Returns TRUE if we can safely
* a) get the current VMs and
* b) start a VM if none is started yet
return gst_amc_jni_initialize_java_vm ()? GINT_TO_POINTER (1) : NULL;
}
+/* Allow the application to set the Java VM */
+void
+gst_amc_jni_set_java_vm (JavaVM * vm)
+{
+ GST_DEBUG ("Application provides Java VM %p", vm);
+ java_vm = vm;
+}
+
gboolean
gst_amc_jni_initialize (void)
{
gint code,
const gchar * format, ...);
+void gst_amc_jni_set_java_vm (JavaVM *java_vm);
+
gboolean gst_amc_jni_initialize (void);
gboolean gst_amc_jni_is_vm_started (void);