summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/androidmedia/gstjniutils.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sys/androidmedia/gstjniutils.c b/sys/androidmedia/gstjniutils.c
index 065d3316d..fca1a9196 100644
--- a/sys/androidmedia/gstjniutils.c
+++ b/sys/androidmedia/gstjniutils.c
@@ -25,8 +25,11 @@
#include <gst/gst.h>
#include <pthread.h>
#include <gmodule.h>
+#include "gstamc.h"
#include "gstjniutils.h"
+#define GST_CAT_DEFAULT gst_amc_debug
+
static GModule *java_module;
static jint (*get_created_java_vms) (JavaVM ** vmBuf, jsize bufLen,
jsize * nVMs);
@@ -448,8 +451,10 @@ check_nativehelper (void)
gboolean ret = FALSE;
module = g_module_open (NULL, G_MODULE_BIND_LOCAL);
- if (!module)
+ if (!module) {
+ GST_WARNING ("g_module_open failure");
return ret;
+ }
/* Check if libnativehelper is loaded in the process and if
* it has these awful wrappers for JNI_CreateJavaVM and
@@ -474,6 +479,8 @@ check_nativehelper (void)
static gboolean
load_java_module (const gchar * name)
{
+ GST_DEBUG ("Trying module '%s'", name);
+
java_module = g_module_open (name, G_MODULE_BIND_LOCAL);
if (!java_module)
goto load_failed;
@@ -486,6 +493,8 @@ load_java_module (const gchar * name)
(gpointer *) & get_created_java_vms))
goto symbol_error;
+ GST_DEBUG ("Managed to open Java module '%s'", GST_STR_NULL (name));
+
return TRUE;
load_failed:
@@ -516,15 +525,14 @@ gst_amc_jni_initialize_java_vm (void)
* FIXME: On Android >= 4.4 we won't be able to safely start a
* VM on our own without using private C++ API!
*/
- if (!check_nativehelper ()) {
+ if (FALSE && !check_nativehelper ()) {
GST_ERROR ("Can't safely check for VMs or start a VM");
return FALSE;
}
- if (!load_java_module (NULL)) {
- if (!load_java_module ("libdvm"))
- return FALSE;
- }
+ if (!load_java_module (NULL) && !load_java_module ("libdvm")
+ && !load_java_module ("libart"))
+ return FALSE;
n_vms = 0;
if (get_created_java_vms (&java_vm, 1, &n_vms) < 0)