summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2015-06-18 14:55:41 +0200
committerSebastian Dröge <sebastian@centricular.com>2015-06-18 14:55:41 +0200
commitb6a4db61d4d83d6743b104a9ce818ecc602d88d3 (patch)
tree2c14b7dc5383f45095860e6a67622ae9a2a47b06 /data
parent27bd780e7daa77ff23a3bbc0466199499fa9aa74 (diff)
Tell the androidmedia plugin about our Java VM we get in JNI_OnLoad() if we can
See corresponding change in androidmedia plugin for more details.
Diffstat (limited to 'data')
-rw-r--r--data/ndk-build/gstreamer_android-1.0.c.in13
1 files changed, 13 insertions, 0 deletions
diff --git a/data/ndk-build/gstreamer_android-1.0.c.in b/data/ndk-build/gstreamer_android-1.0.c.in
index fca8ba0d..b4d67de1 100644
--- a/data/ndk-build/gstreamer_android-1.0.c.in
+++ b/data/ndk-build/gstreamer_android-1.0.c.in
@@ -514,6 +514,7 @@ jint
JNI_OnLoad (JavaVM * vm, void * reserved)
{
JNIEnv *env = NULL;
+ GModule *module;
if ((*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_4) != JNI_OK) {
__android_log_print (ANDROID_LOG_ERROR, "GStreamer",
@@ -533,6 +534,18 @@ JNI_OnLoad (JavaVM * vm, void * reserved)
return 0;
}
+ /* Tell the androidmedia plugin about the Java VM if we can */
+ module = g_module_open (NULL, G_MODULE_BIND_LOCAL);
+ if (module) {
+ void (*set_java_vm) (JavaVM *) = NULL;
+
+ if (g_module_symbol (module, "gst_amc_jni_set_java_vm",
+ (gpointer *) & set_java_vm) && set_java_vm) {
+ set_java_vm (vm);
+ }
+ g_module_close (module);
+ }
+
return JNI_VERSION_1_4;
}