summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-01-03 18:54:35 +0200
committerSebastian Dröge <sebastian@centricular.com>2017-01-04 22:17:33 +0200
commit737b3f52626952f04027db12823f70108fe9c182 (patch)
tree7957f8e9baefcd597664684e92e5e2bd159a1d8d /data
parent1744540fe428cd53be65706548598f0989f642db (diff)
ndk-build: Provide API for requesting the Java VM
This is used by the androidmedia plugin and potentially others.
Diffstat (limited to 'data')
-rw-r--r--data/ndk-build/gstreamer_android-1.0.c.in16
1 files changed, 14 insertions, 2 deletions
diff --git a/data/ndk-build/gstreamer_android-1.0.c.in b/data/ndk-build/gstreamer_android-1.0.c.in
index da3851ee..9b3ec37c 100644
--- a/data/ndk-build/gstreamer_android-1.0.c.in
+++ b/data/ndk-build/gstreamer_android-1.0.c.in
@@ -44,6 +44,7 @@ __sighandler_t bsd_signal(int signum, __sighandler_t handler)
static jobject _context = NULL;
static jobject _class_loader = NULL;
+static JavaVM *_java_vm = NULL;
static GstClockTime _priv_gst_info_start_time;
#define GST_G_IO_MODULE_DECLARE(name) \
@@ -401,17 +402,23 @@ get_application_dirs (JNIEnv * env, jobject context, gchar ** cache_dir,
}
jobject
-gst_android_get_application_context ()
+gst_android_get_application_context (void)
{
return _context;
}
jobject
-gst_android_get_application_class_loader ()
+gst_android_get_application_class_loader (void)
{
return _class_loader;
}
+JavaVM *
+gst_android_get_java_vm (void)
+{
+ return _java_vm;
+}
+
static gboolean
init (JNIEnv *env, jobject context)
{
@@ -573,6 +580,9 @@ JNI_OnLoad (JavaVM * vm, void * reserved)
return 0;
}
+ /* Remember Java VM */
+ _java_vm = vm;
+
/* Tell the androidmedia plugin about the Java VM if we can */
module = g_module_open (NULL, G_MODULE_BIND_LOCAL);
if (module) {
@@ -608,4 +618,6 @@ JNI_OnUnload (JavaVM * vm, void * reversed)
(*env)->DeleteGlobalRef (env, _class_loader);
_class_loader = NULL;
}
+
+ _java_vm = NULL;
}