From: Matthew Waters Date: Thu, 31 Aug 2017 08:56:37 +0000 (+1000) Subject: amc: actually use the provided application class loader X-Git-Tag: 1.19.3~507^2~4890 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d2382fb27378bfaec938f5c747fe68500f5c499;p=platform%2Fupstream%2Fgstreamer.git amc: actually use the provided application class loader For the camera and sensor Fixes a couple of ClassNotFound java exceptions when initializing GStreamer off the main thread. --- diff --git a/sys/androidmedia/gst-android-hardware-camera.c b/sys/androidmedia/gst-android-hardware-camera.c index aa574bd2be..639e0240f1 100644 --- a/sys/androidmedia/gst-android-hardware-camera.c +++ b/sys/androidmedia/gst-android-hardware-camera.c @@ -1590,8 +1590,8 @@ _init_classes (void) if (!org_freedesktop_gstreamer_androidmedia_gstahccallback.klass) { org_freedesktop_gstreamer_androidmedia_gstahccallback.klass = - gst_amc_jni_get_class (env, &err, - "org/freedesktop/gstreamer/androidmedia/GstAhcCallback"); + gst_amc_jni_get_application_class (env, + "org/freedesktop/gstreamer/androidmedia/GstAhcCallback", &err); } if (!org_freedesktop_gstreamer_androidmedia_gstahccallback.klass) goto failed; diff --git a/sys/androidmedia/gst-android-hardware-sensor.c b/sys/androidmedia/gst-android-hardware-sensor.c index d4fd71caf1..d5a68b5475 100644 --- a/sys/androidmedia/gst-android-hardware-sensor.c +++ b/sys/androidmedia/gst-android-hardware-sensor.c @@ -569,8 +569,8 @@ _init_classes (void) /* org.freedesktop.gstreamer.androidmedia.GstAhsCallback */ if (!org_freedesktop_gstreamer_androidmedia_gstahscallback.klass) { org_freedesktop_gstreamer_androidmedia_gstahscallback.klass = - gst_amc_jni_get_class (env, &err, - "org/freedesktop/gstreamer/androidmedia/GstAhsCallback"); + gst_amc_jni_get_application_class (env, + "org/freedesktop/gstreamer/androidmedia/GstAhsCallback", &err); } if (!org_freedesktop_gstreamer_androidmedia_gstahscallback.klass) goto failed; diff --git a/sys/androidmedia/gstjniutils.c b/sys/androidmedia/gstjniutils.c index a5b8e0d721..0f2efc2d40 100644 --- a/sys/androidmedia/gstjniutils.c +++ b/sys/androidmedia/gstjniutils.c @@ -869,6 +869,13 @@ gst_amc_jni_get_application_class (JNIEnv * env, const gchar * name, jclass class_loader_cls = NULL; jmethodID load_class_id = 0; + GST_LOG ("attempting to retrieve class %s", name); + + if (!get_class_loader) { + g_set_error (err, GST_LIBRARY_ERROR, GST_LIBRARY_ERROR_FAILED, + "Could not retreive application class loader function"); + goto done; + } class_loader = get_class_loader (); if (!class_loader) { @@ -887,7 +894,7 @@ gst_amc_jni_get_application_class (JNIEnv * env, const gchar * name, load_class_id = gst_amc_jni_get_method_id (env, err, class_loader_cls, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;"); - if (!class_loader_cls) { + if (!load_class_id) { goto done; }