summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2015-03-13 16:15:14 +0100
committerEdward Hervey <bilboed@bilboed.com>2015-03-13 17:41:26 +0100
commit4eb4352759eb769c3258f62303cc806302e46009 (patch)
treedf50c58806642e4f8020fdedda6e5bd4da85e42d
parent26a4ea7e6f3f32af32d3668a5b122cb7106b9422 (diff)
WIP androidmedia: Add more debugging and deactivate a checkamczerocopy-gl-wip2
nativehelper is not available/needed on Lollipop
-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)