From 35ef602b7ddab3c18f724bcf12f18903e58e60d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 15 Mar 2015 16:55:00 +0000 Subject: androidmedia: Add helpers for calling static methods --- sys/androidmedia/gstjniutils.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'sys/androidmedia/gstjniutils.h') diff --git a/sys/androidmedia/gstjniutils.h b/sys/androidmedia/gstjniutils.h index 78dad43d6..0c75c4583 100644 --- a/sys/androidmedia/gstjniutils.h +++ b/sys/androidmedia/gstjniutils.h @@ -87,6 +87,24 @@ gboolean gst_amc_jni_is_vm_started (void); JNIEnv *gst_amc_jni_get_env (void); +#define DEF_CALL_STATIC_TYPE_METHOD(_type, _name, _jname, _retval) \ +_type gst_amc_jni_call_static_##_name##_method (JNIEnv *env, GError ** err, jclass klass, jmethodID methodID, ...) + +DEF_CALL_STATIC_TYPE_METHOD (gboolean, boolean, Boolean, FALSE); +DEF_CALL_STATIC_TYPE_METHOD (gint8, byte, Byte, G_MININT8); +DEF_CALL_STATIC_TYPE_METHOD (gshort, short, Short, G_MINSHORT); +DEF_CALL_STATIC_TYPE_METHOD (gint, int, Int, G_MININT); +DEF_CALL_STATIC_TYPE_METHOD (gchar, char, Char, 0); +DEF_CALL_STATIC_TYPE_METHOD (glong, long, Long, G_MINLONG); +DEF_CALL_STATIC_TYPE_METHOD (gfloat, float, Float, G_MINFLOAT); +DEF_CALL_STATIC_TYPE_METHOD (gdouble, double, Double, G_MINDOUBLE); +DEF_CALL_STATIC_TYPE_METHOD (jobject, object, Object, NULL); + +gboolean gst_amc_jni_call_static_void_method (JNIEnv * env, + GError ** error, + jclass klass, + jmethodID method, ...); + #define DEF_CALL_TYPE_METHOD(_type, _name, _jname, _retval) \ _type gst_amc_jni_call_##_name##_method (JNIEnv *env, GError ** err, jobject obj, jmethodID methodID, ...) @@ -102,7 +120,7 @@ DEF_CALL_TYPE_METHOD (jobject, object, Object, NULL); gboolean gst_amc_jni_call_void_method (JNIEnv * env, GError ** error, - jclass klass, + jobject obj, jmethodID method, ...); #define DEF_GET_TYPE_FIELD(_type, _name, _jname, _retval) \ -- cgit v1.2.1