dvm: Rename gst-dvm.[ch] to gstdvm.[ch] for consistency with other GStreamer code
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 13 Dec 2012 17:56:01 +0000 (17:56 +0000)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 21 Jan 2016 18:49:15 +0000 (13:49 -0500)
15 files changed:
gst-libs/gst/dvm/Makefile.am
gst-libs/gst/dvm/gst-dvm.c [deleted file]
gst-libs/gst/dvm/gst-dvm.h [deleted file]
gst-libs/gst/dvm/gstdvm.c [new file with mode: 0644]
gst-libs/gst/dvm/gstdvm.h [new file with mode: 0644]
sys/androidcamera/Makefile.am
sys/androidcamera/gst-android-graphics-imageformat.c
sys/androidcamera/gst-android-graphics-surfacetexture.c
sys/androidcamera/gst-android-hardware-camera.c
sys/androidcamera/gst-androidcamera.c
sys/androidcamera/gstahcsrc.c
sys/androidmedia/gst-android-media-mediacodec.c
sys/androidmedia/gst-android-media-mediacodecinfo.c
sys/androidmedia/gst-android-media-mediacodeclist.c
sys/androidmedia/gst-android-media-mediaformat.c

index d2f4d2abad1911e3612db216faa48f2e1a31df7e..3da6f8616c82d850f6813dd1472adaf5cca212ea 100644 (file)
@@ -2,10 +2,10 @@ lib_LTLIBRARIES = libgstdvm-@GST_MAJORMINOR@.la
 libgstdvmincludedir = $(includedir)/gstreamer-@GST_MAJORMINOR@/gst/dvm
 
 libgstdvminclude_HEADERS = \
-       gst-dvm.h
+       gstdvm.h
 
 libgstdvm_@GST_MAJORMINOR@_la_SOURCES = \
-       gst-dvm.c
+       gstdvm.c
 
 libgstdvm_@GST_MAJORMINOR@_la_CFLAGS = \
        $(GST_PLUGINS_BAD_CFLAGS) \
diff --git a/gst-libs/gst/dvm/gst-dvm.c b/gst-libs/gst/dvm/gst-dvm.c
deleted file mode 100644 (file)
index 8f84b0c..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2012, Collabora Ltd.
- *   Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
- * Copyright (C) 2012, Cisco Systems, Inc.
- *   Author: Youness Alaoui <youness.alaoui@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "gst-dvm.h"
-
-#include <pthread.h>
-
-GST_DEBUG_CATEGORY (gst_dvm_debug);
-#define GST_CAT_DEFAULT gst_dvm_debug
-
-static GModule *java_module;
-static jint (*get_created_java_vms) (JavaVM ** vmBuf, jsize bufLen,
-    jsize * nVMs);
-static jint (*create_java_vm) (JavaVM ** p_vm, JNIEnv ** p_env, void *vm_args);
-static JavaVM *java_vm = NULL;
-static gboolean started_java_vm = FALSE;
-
-static pthread_key_t current_jni_env;
-
-static JNIEnv *
-gst_dvm_attach_current_thread (void)
-{
-  JNIEnv *env;
-  JavaVMAttachArgs args;
-
-  GST_DEBUG ("Attaching thread %p", g_thread_self ());
-  args.version = JNI_VERSION_1_6;
-  args.name = NULL;
-  args.group = NULL;
-
-  if ((*java_vm)->AttachCurrentThread (java_vm, &env, &args) < 0) {
-    GST_ERROR ("Failed to attach current thread");
-    return NULL;
-  }
-
-  return env;
-}
-
-static void
-gst_dvm_detach_current_thread (void *env)
-{
-  GST_DEBUG ("Detaching thread %p", g_thread_self ());
-  (*java_vm)->DetachCurrentThread (java_vm);
-}
-
-JNIEnv *
-gst_dvm_get_env (void)
-{
-  JNIEnv *env;
-
-  if ((env = pthread_getspecific (current_jni_env)) == NULL) {
-    env = gst_dvm_attach_current_thread ();
-    pthread_setspecific (current_jni_env, env);
-  }
-
-  return env;
-}
-
-gboolean
-gst_dvm_init (void)
-{
-  jsize n_vms;
-
-  GST_DEBUG_CATEGORY_INIT (gst_dvm_debug, "dvm", 0, "DVM");
-
-  pthread_key_create (&current_jni_env, gst_dvm_detach_current_thread);
-
-  java_module = g_module_open ("libdvm", G_MODULE_BIND_LOCAL);
-  if (!java_module)
-    goto load_failed;
-
-  if (!g_module_symbol (java_module, "JNI_CreateJavaVM",
-          (gpointer *) & create_java_vm))
-    goto symbol_error;
-
-  if (!g_module_symbol (java_module, "JNI_GetCreatedJavaVMs",
-          (gpointer *) & get_created_java_vms))
-    goto symbol_error;
-
-  n_vms = 0;
-  if (get_created_java_vms (&java_vm, 1, &n_vms) < 0)
-    goto get_created_failed;
-
-  if (n_vms > 0) {
-    GST_DEBUG ("Successfully got existing Java VM %p", java_vm);
-  } else {
-    JNIEnv *env;
-    JavaVMInitArgs vm_args;
-    JavaVMOption options[4];
-
-    options[0].optionString = "-verbose:jni";
-    options[1].optionString = "-verbose:gc";
-    options[2].optionString = "-Xcheck:jni";
-    options[3].optionString = "-Xdebug";
-
-    vm_args.version = JNI_VERSION_1_4;
-    vm_args.options = options;
-    vm_args.nOptions = 4;
-    vm_args.ignoreUnrecognized = JNI_TRUE;
-    if (create_java_vm (&java_vm, &env, &vm_args) < 0)
-      goto create_failed;
-    GST_DEBUG ("Successfully created Java VM %p", java_vm);
-
-    started_java_vm = TRUE;
-  }
-
-  return java_vm != NULL;
-
-load_failed:
-  {
-    GST_ERROR ("Failed to load libdvm: %s", g_module_error ());
-    return FALSE;
-  }
-symbol_error:
-  {
-    GST_ERROR ("Failed to locate required JNI symbols in libdvm: %s",
-        g_module_error ());
-    g_module_close (java_module);
-    java_module = NULL;
-    return FALSE;
-  }
-get_created_failed:
-  {
-    GST_ERROR ("Failed to get already created VMs");
-    g_module_close (java_module);
-    java_module = NULL;
-    return FALSE;
-  }
-create_failed:
-  {
-    GST_ERROR ("Failed to create a Java VM");
-    g_module_close (java_module);
-    java_module = NULL;
-    return FALSE;
-  }
-}
-
-gboolean
-gst_dvm_is_own_vm (void)
-{
-  return started_java_vm;
-}
diff --git a/gst-libs/gst/dvm/gst-dvm.h b/gst-libs/gst/dvm/gst-dvm.h
deleted file mode 100644 (file)
index b91e7fc..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/* Dalvik Virtual Machine helper functions
- *
- * Copyright (C) 2012, Collabora Ltd.
- *   Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
- * Copyright (C) 2012, Cisco Systems, Inc.
- *   Author: Youness Alaoui <youness.alaoui@collabora.co.uk>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
- *
- */
-
-#ifndef __GST_DVM_H__
-#define __GST_DVM_H__
-
-#include <gst/gst.h>
-#include <jni.h>
-
-#define GST_DVM_GET_CLASS(k, name) {                                    \
-    jclass tmp;                                                         \
-                                                                        \
-    tmp = (*env)->FindClass (env, name);                                \
-    if (!tmp) {                                                         \
-      (*env)->ExceptionClear (env);                                     \
-      GST_ERROR ("Failed to get class %s", name);                       \
-      return FALSE;                                                     \
-    }                                                                   \
-                                                                        \
-    k.klass = (*env)->NewGlobalRef (env, tmp);                          \
-    if (!k.klass) {                                                     \
-      (*env)->ExceptionClear (env);                                     \
-      (*env)->DeleteLocalRef (env, tmp);                                \
-      GST_ERROR ("Failed to get %s class global reference", name);      \
-      return FALSE;                                                     \
-    }                                                                   \
-    (*env)->DeleteLocalRef (env, tmp);                                  \
-  }
-#define GST_DVM_GET_STATIC_METHOD(k, method, signature)                 \
-  k.method = (*env)->GetStaticMethodID (env, k.klass, #method,          \
-      signature);                                                       \
-  if (!k.method) {                                                      \
-    (*env)->ExceptionClear (env);                                       \
-    GST_ERROR ("Failed to get static method %s for %s", #method, #k);   \
-    return FALSE;                                                       \
-  }
-
-#define GST_DVM_GET_METHOD(k, method, signature)                        \
-  k.method = (*env)->GetMethodID (env, k.klass, #method, signature);    \
-  if (!k.method) {                                                      \
-    (*env)->ExceptionClear (env);                                       \
-    GST_ERROR ("Failed to get method %s for %s", #method, #k);          \
-    return FALSE;                                                       \
-  }
-
-#define GST_DVM_GET_CONSTRUCTOR(k, field, signature)                    \
-  k.field = (*env)->GetMethodID (env, k.klass, "<init>",  signature);   \
-  if (!k.field) {                                                       \
-    (*env)->ExceptionClear (env);                                       \
-    GST_ERROR ("Failed to get constructor %s for %s", #field, #k);      \
-    return FALSE;                                                       \
-  }
-
-#define GST_DVM_GET_STATIC_FIELD(k, field, signature)                   \
-  k.field = (*env)->GetStaticFieldID (env, k.klass, #field, signature); \
-  if (!k.field) {                                                       \
-    (*env)->ExceptionClear (env);                                       \
-    GST_ERROR ("Failed to get static field %s for %s", #field, #k);     \
-    return FALSE;                                                       \
-  }
-
-#define GST_DVM_GET_FIELD(k, field, signature)                          \
-  k.field = (*env)->GetFieldID (env, k.klass, #field, signature);       \
-  if (!k.field) {                                                       \
-    (*env)->ExceptionClear (env);                                       \
-    GST_ERROR ("Failed to get field %s for %s", #field, #k);            \
-    return FALSE;                                                       \
-  }
-
-#define GST_DVM_GET_CONSTANT(k, field, type, signature) {               \
-    jfieldID id;                                                        \
-                                                                        \
-    id = (*env)->GetStaticFieldID (env, k.klass, #field, signature);    \
-    if (!id) {                                                          \
-      (*env)->ExceptionClear (env);                                     \
-      GST_ERROR ("Failed to get static field %s for %s", #field, #k);   \
-      return FALSE;                                                     \
-    }                                                                   \
-    k.field = (*env)->GetStatic##type##Field (env, k.klass, id);        \
-    if ((*env)->ExceptionCheck (env)) {                                 \
-      (*env)->ExceptionClear (env);                                     \
-      GST_ERROR ("Failed to get " #type " constant %s", #field);        \
-      return FALSE;                                                     \
-    }                                                                   \
-  }
-
-#define GST_DVM_STATIC_CALL(error_statement, type, k, method, ...)      \
-  (*env)->CallStatic##type##Method (env, k.klass, k.method, ## __VA_ARGS__); \
-  if ((*env)->ExceptionCheck (env)) {                                   \
-    GST_ERROR ("Failed to call Java method");                           \
-    (*env)->ExceptionDescribe (env);                                    \
-    (*env)->ExceptionClear (env);                                       \
-    error_statement;                                                    \
-  }
-
-#define GST_DVM_CALL(error_statement, obj, type, k, method, ...)        \
-  (*env)->Call##type##Method (env, obj, k.method, ## __VA_ARGS__);      \
-  if ((*env)->ExceptionCheck (env)) {                                   \
-    GST_ERROR ("Failed to call Java method");                           \
-    (*env)->ExceptionDescribe (env);                                    \
-    (*env)->ExceptionClear (env);                                       \
-    error_statement;                                                    \
-  }
-
-#define GST_DVM_FIELD(error_statement, obj, type, k, field)             \
-  (*env)->Get##type##Field (env, obj, k.field);                         \
-  if ((*env)->ExceptionCheck (env)) {                                   \
-    GST_ERROR ("Failed to get Java field");                             \
-    (*env)->ExceptionDescribe (env);                                    \
-    (*env)->ExceptionClear (env);                                       \
-    error_statement;                                                    \
-  }
-
-#define GST_DVM_STATIC_FIELD(error_statement, type, k, field)           \
-  (*env)->Get##type##Field (env, k.klass, k.field);                     \
-  if ((*env)->ExceptionCheck (env)) {                                   \
-    GST_ERROR ("Failed to get Java static field");                      \
-    (*env)->ExceptionDescribe (env);                                    \
-    (*env)->ExceptionClear (env);                                       \
-    error_statement;                                                    \
-  }
-
-JNIEnv *gst_dvm_get_env (void);
-gboolean gst_dvm_init (void);
-gboolean gst_dvm_is_own_vm (void);
-
-#endif /* __GST_DVM_H__ */
diff --git a/gst-libs/gst/dvm/gstdvm.c b/gst-libs/gst/dvm/gstdvm.c
new file mode 100644 (file)
index 0000000..82dea7b
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * Copyright (C) 2012, Collabora Ltd.
+ *   Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ * Copyright (C) 2012, Cisco Systems, Inc.
+ *   Author: Youness Alaoui <youness.alaoui@collabora.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstdvm.h"
+
+#include <pthread.h>
+
+GST_DEBUG_CATEGORY (gst_dvm_debug);
+#define GST_CAT_DEFAULT gst_dvm_debug
+
+static GModule *java_module;
+static jint (*get_created_java_vms) (JavaVM ** vmBuf, jsize bufLen,
+    jsize * nVMs);
+static jint (*create_java_vm) (JavaVM ** p_vm, JNIEnv ** p_env, void *vm_args);
+static JavaVM *java_vm = NULL;
+static gboolean started_java_vm = FALSE;
+
+static pthread_key_t current_jni_env;
+
+static JNIEnv *
+gst_dvm_attach_current_thread (void)
+{
+  JNIEnv *env;
+  JavaVMAttachArgs args;
+
+  GST_DEBUG ("Attaching thread %p", g_thread_self ());
+  args.version = JNI_VERSION_1_6;
+  args.name = NULL;
+  args.group = NULL;
+
+  if ((*java_vm)->AttachCurrentThread (java_vm, &env, &args) < 0) {
+    GST_ERROR ("Failed to attach current thread");
+    return NULL;
+  }
+
+  return env;
+}
+
+static void
+gst_dvm_detach_current_thread (void *env)
+{
+  GST_DEBUG ("Detaching thread %p", g_thread_self ());
+  (*java_vm)->DetachCurrentThread (java_vm);
+}
+
+JNIEnv *
+gst_dvm_get_env (void)
+{
+  JNIEnv *env;
+
+  if ((env = pthread_getspecific (current_jni_env)) == NULL) {
+    env = gst_dvm_attach_current_thread ();
+    pthread_setspecific (current_jni_env, env);
+  }
+
+  return env;
+}
+
+gboolean
+gst_dvm_init (void)
+{
+  jsize n_vms;
+
+  GST_DEBUG_CATEGORY_INIT (gst_dvm_debug, "dvm", 0, "DVM");
+
+  pthread_key_create (&current_jni_env, gst_dvm_detach_current_thread);
+
+  java_module = g_module_open ("libdvm", G_MODULE_BIND_LOCAL);
+  if (!java_module)
+    goto load_failed;
+
+  if (!g_module_symbol (java_module, "JNI_CreateJavaVM",
+          (gpointer *) & create_java_vm))
+    goto symbol_error;
+
+  if (!g_module_symbol (java_module, "JNI_GetCreatedJavaVMs",
+          (gpointer *) & get_created_java_vms))
+    goto symbol_error;
+
+  n_vms = 0;
+  if (get_created_java_vms (&java_vm, 1, &n_vms) < 0)
+    goto get_created_failed;
+
+  if (n_vms > 0) {
+    GST_DEBUG ("Successfully got existing Java VM %p", java_vm);
+  } else {
+    JNIEnv *env;
+    JavaVMInitArgs vm_args;
+    JavaVMOption options[4];
+
+    options[0].optionString = "-verbose:jni";
+    options[1].optionString = "-verbose:gc";
+    options[2].optionString = "-Xcheck:jni";
+    options[3].optionString = "-Xdebug";
+
+    vm_args.version = JNI_VERSION_1_4;
+    vm_args.options = options;
+    vm_args.nOptions = 4;
+    vm_args.ignoreUnrecognized = JNI_TRUE;
+    if (create_java_vm (&java_vm, &env, &vm_args) < 0)
+      goto create_failed;
+    GST_DEBUG ("Successfully created Java VM %p", java_vm);
+
+    started_java_vm = TRUE;
+  }
+
+  return java_vm != NULL;
+
+load_failed:
+  {
+    GST_ERROR ("Failed to load libdvm: %s", g_module_error ());
+    return FALSE;
+  }
+symbol_error:
+  {
+    GST_ERROR ("Failed to locate required JNI symbols in libdvm: %s",
+        g_module_error ());
+    g_module_close (java_module);
+    java_module = NULL;
+    return FALSE;
+  }
+get_created_failed:
+  {
+    GST_ERROR ("Failed to get already created VMs");
+    g_module_close (java_module);
+    java_module = NULL;
+    return FALSE;
+  }
+create_failed:
+  {
+    GST_ERROR ("Failed to create a Java VM");
+    g_module_close (java_module);
+    java_module = NULL;
+    return FALSE;
+  }
+}
+
+gboolean
+gst_dvm_is_own_vm (void)
+{
+  return started_java_vm;
+}
diff --git a/gst-libs/gst/dvm/gstdvm.h b/gst-libs/gst/dvm/gstdvm.h
new file mode 100644 (file)
index 0000000..b91e7fc
--- /dev/null
@@ -0,0 +1,147 @@
+/* Dalvik Virtual Machine helper functions
+ *
+ * Copyright (C) 2012, Collabora Ltd.
+ *   Author: Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ * Copyright (C) 2012, Cisco Systems, Inc.
+ *   Author: Youness Alaoui <youness.alaoui@collabora.co.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ *
+ */
+
+#ifndef __GST_DVM_H__
+#define __GST_DVM_H__
+
+#include <gst/gst.h>
+#include <jni.h>
+
+#define GST_DVM_GET_CLASS(k, name) {                                    \
+    jclass tmp;                                                         \
+                                                                        \
+    tmp = (*env)->FindClass (env, name);                                \
+    if (!tmp) {                                                         \
+      (*env)->ExceptionClear (env);                                     \
+      GST_ERROR ("Failed to get class %s", name);                       \
+      return FALSE;                                                     \
+    }                                                                   \
+                                                                        \
+    k.klass = (*env)->NewGlobalRef (env, tmp);                          \
+    if (!k.klass) {                                                     \
+      (*env)->ExceptionClear (env);                                     \
+      (*env)->DeleteLocalRef (env, tmp);                                \
+      GST_ERROR ("Failed to get %s class global reference", name);      \
+      return FALSE;                                                     \
+    }                                                                   \
+    (*env)->DeleteLocalRef (env, tmp);                                  \
+  }
+#define GST_DVM_GET_STATIC_METHOD(k, method, signature)                 \
+  k.method = (*env)->GetStaticMethodID (env, k.klass, #method,          \
+      signature);                                                       \
+  if (!k.method) {                                                      \
+    (*env)->ExceptionClear (env);                                       \
+    GST_ERROR ("Failed to get static method %s for %s", #method, #k);   \
+    return FALSE;                                                       \
+  }
+
+#define GST_DVM_GET_METHOD(k, method, signature)                        \
+  k.method = (*env)->GetMethodID (env, k.klass, #method, signature);    \
+  if (!k.method) {                                                      \
+    (*env)->ExceptionClear (env);                                       \
+    GST_ERROR ("Failed to get method %s for %s", #method, #k);          \
+    return FALSE;                                                       \
+  }
+
+#define GST_DVM_GET_CONSTRUCTOR(k, field, signature)                    \
+  k.field = (*env)->GetMethodID (env, k.klass, "<init>",  signature);   \
+  if (!k.field) {                                                       \
+    (*env)->ExceptionClear (env);                                       \
+    GST_ERROR ("Failed to get constructor %s for %s", #field, #k);      \
+    return FALSE;                                                       \
+  }
+
+#define GST_DVM_GET_STATIC_FIELD(k, field, signature)                   \
+  k.field = (*env)->GetStaticFieldID (env, k.klass, #field, signature); \
+  if (!k.field) {                                                       \
+    (*env)->ExceptionClear (env);                                       \
+    GST_ERROR ("Failed to get static field %s for %s", #field, #k);     \
+    return FALSE;                                                       \
+  }
+
+#define GST_DVM_GET_FIELD(k, field, signature)                          \
+  k.field = (*env)->GetFieldID (env, k.klass, #field, signature);       \
+  if (!k.field) {                                                       \
+    (*env)->ExceptionClear (env);                                       \
+    GST_ERROR ("Failed to get field %s for %s", #field, #k);            \
+    return FALSE;                                                       \
+  }
+
+#define GST_DVM_GET_CONSTANT(k, field, type, signature) {               \
+    jfieldID id;                                                        \
+                                                                        \
+    id = (*env)->GetStaticFieldID (env, k.klass, #field, signature);    \
+    if (!id) {                                                          \
+      (*env)->ExceptionClear (env);                                     \
+      GST_ERROR ("Failed to get static field %s for %s", #field, #k);   \
+      return FALSE;                                                     \
+    }                                                                   \
+    k.field = (*env)->GetStatic##type##Field (env, k.klass, id);        \
+    if ((*env)->ExceptionCheck (env)) {                                 \
+      (*env)->ExceptionClear (env);                                     \
+      GST_ERROR ("Failed to get " #type " constant %s", #field);        \
+      return FALSE;                                                     \
+    }                                                                   \
+  }
+
+#define GST_DVM_STATIC_CALL(error_statement, type, k, method, ...)      \
+  (*env)->CallStatic##type##Method (env, k.klass, k.method, ## __VA_ARGS__); \
+  if ((*env)->ExceptionCheck (env)) {                                   \
+    GST_ERROR ("Failed to call Java method");                           \
+    (*env)->ExceptionDescribe (env);                                    \
+    (*env)->ExceptionClear (env);                                       \
+    error_statement;                                                    \
+  }
+
+#define GST_DVM_CALL(error_statement, obj, type, k, method, ...)        \
+  (*env)->Call##type##Method (env, obj, k.method, ## __VA_ARGS__);      \
+  if ((*env)->ExceptionCheck (env)) {                                   \
+    GST_ERROR ("Failed to call Java method");                           \
+    (*env)->ExceptionDescribe (env);                                    \
+    (*env)->ExceptionClear (env);                                       \
+    error_statement;                                                    \
+  }
+
+#define GST_DVM_FIELD(error_statement, obj, type, k, field)             \
+  (*env)->Get##type##Field (env, obj, k.field);                         \
+  if ((*env)->ExceptionCheck (env)) {                                   \
+    GST_ERROR ("Failed to get Java field");                             \
+    (*env)->ExceptionDescribe (env);                                    \
+    (*env)->ExceptionClear (env);                                       \
+    error_statement;                                                    \
+  }
+
+#define GST_DVM_STATIC_FIELD(error_statement, type, k, field)           \
+  (*env)->Get##type##Field (env, k.klass, k.field);                     \
+  if ((*env)->ExceptionCheck (env)) {                                   \
+    GST_ERROR ("Failed to get Java static field");                      \
+    (*env)->ExceptionDescribe (env);                                    \
+    (*env)->ExceptionClear (env);                                       \
+    error_statement;                                                    \
+  }
+
+JNIEnv *gst_dvm_get_env (void);
+gboolean gst_dvm_init (void);
+gboolean gst_dvm_is_own_vm (void);
+
+#endif /* __GST_DVM_H__ */
index f2a6ac5e2b8e258a43cf562d61d710436091de53..e24e94404f9d3d5ea2389ecc392664d830873eb8 100644 (file)
@@ -18,6 +18,7 @@ noinst_HEADERS = \
        gst-android-graphics-imageformat.h
 
 libgstandroidcamera_la_CFLAGS = \
+       $(GST_PLUGINS_BAD_CFLAGS) \
        $(GST_PLUGINS_BASE_CFLAGS) \
        $(GST_BASE_CFLAGS) \
        $(GST_CFLAGS) \
@@ -25,7 +26,8 @@ libgstandroidcamera_la_CFLAGS = \
 libgstandroidcamera_la_LIBADD = \
        $(GST_PLUGINS_BASE_LIBS) \
        $(GST_BASE_LIBS) \
-       $(GST_LIBS)
+       $(GST_LIBS) \
+       $(top_builddir)/gst-libs/gst/dvm/libgstdvm-@GST_MAJORMINOR@.la
 libgstandroidcamera_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
 libgstandroidcamera_la_LIBTOOLFLAGS = --tag=disable-static
 
index 3140af048edb96d6d97659bd586309650ce0c9b1..577131f27b0ca51faef370860499c189f0edf953 100644 (file)
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 
-#include <gst/dvm/gst-dvm.h>
+#include <gst/dvm/gstdvm.h>
 
 #include "gst-android-graphics-imageformat.h"
 
index bb78f0273c0606dc429c0c46bb3f1114cd00db7e..06a29453fab0c1cb72d01c887ed18b4aaa17a3e2 100644 (file)
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 
-#include <gst/dvm/gst-dvm.h>
+#include <gst/dvm/gstdvm.h>
 
 #include "gst-android-graphics-surfacetexture.h"
 
index 945c6e6cf48efe063c47ebf180ed60f0d45db428..09940b662d2575a209839ea843b37e0bd39febbf 100644 (file)
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 
-#include <gst/dvm/gst-dvm.h>
+#include <gst/dvm/gstdvm.h>
 
 #include "gstahccallback.h"
 #include "gst-android-hardware-camera.h"
index 6aa2d412c088b97850cf2eeb8be189928afe12d7..d836add3ed527521211578719ca2ecf70b9e02ed 100644 (file)
@@ -23,7 +23,7 @@
 #endif
 
 #include <gst/gst.h>
-#include <gst/dvm/gst-dvm.h>
+#include <gst/dvm/gstdvm.h>
 
 #include "gst-android-hardware-camera.h"
 #include "gstahcsrc.h"
index 6f8f056e9276de0cbb80a2bca2a93e22c1c12e10..7ed1f22973f34db2fd04fec413d610367c33d180 100644 (file)
@@ -73,7 +73,7 @@
 #include <gst/video/video.h>
 #include <gst/interfaces/propertyprobe.h>
 #include <gst/interfaces/photography.h>
-#include <gst/dvm/gst-dvm.h>
+#include <gst/dvm/gstdvm.h>
 
 #include "gstahcsrc.h"
 
index 5cdbbd3a612635b1c1481cc472f4fd5bde9cd5d7..f87669c30dcdcfc73f08f846b0ccb60f351be2f6 100644 (file)
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 
-#include <gst/dvm/gst-dvm.h>
+#include <gst/dvm/gstdvm.h>
 
 #include "gst-android-media-mediacodec.h"
 
index bd897a7373e0c85b9f6c69656f037bc8287d7c4d..86df3e0f987d4326c14b2a68616c20494d98d96d 100644 (file)
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 
-#include <gst/dvm/gst-dvm.h>
+#include <gst/dvm/gstdvm.h>
 
 #include "gst-android-media-mediacodecinfo.h"
 
index faa5a8f89ac7144e5fe573d22fcdabdb54805979..dddcf13dd197cc356692a355581be36ad3c65942 100644 (file)
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 
-#include <gst/dvm/gst-dvm.h>
+#include <gst/dvm/gstdvm.h>
 
 #include "gst-android-media-mediacodeclist.h"
 
index e0ed338399fc6726294710221b2d4f8f4b9089b1..ee1529b6cb8584a20ae2c989defb117762044c7c 100644 (file)
@@ -23,7 +23,7 @@
 #include "config.h"
 #endif
 
-#include <gst/dvm/gst-dvm.h>
+#include <gst/dvm/gstdvm.h>
 #include <string.h>
 
 #include "gst-android-media-mediaformat.h"